Fix test case for getOptionalSone().
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 4 Nov 2013 21:02:00 +0000 (22:02 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:52 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java

index dab94a4..d510ab6 100644 (file)
@@ -270,10 +270,12 @@ public class AbstractSoneCommandTest {
                assertThat(parsedSone.isPresent(), is(false));
        }
 
-       @Test(expected = FcpException.class)
-       public void testParsingAnOptionalSoneFromANonExistingFieldCausesAnError() throws FcpException {
+       @Test
+       public void testParsingAnOptionalSoneFromANonExistingField() throws FcpException {
                SimpleFieldSet soneFieldSet = new SimpleFieldSetBuilder().put("Sone", "jXH8d-eFdm14R69WyaCgQoSjaY0jl-Ut6etlXjK0e6E").get();
-               abstractSoneCommand.getOptionalSone(soneFieldSet, "RealSone");
+               Optional<Sone> sone = abstractSoneCommand.getOptionalSone(soneFieldSet, "RealSone");
+               assertThat(sone, notNullValue());
+               assertThat(sone.isPresent(), is(false));
        }
 
        @Test