From 7b1168dfc972e38d4cd5779f34043f96fc1667c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Mon, 4 Nov 2013 22:02:00 +0100 Subject: [PATCH] Fix test case for getOptionalSone(). --- .../java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java index dab94a4..d510ab6 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/AbstractSoneCommandTest.java @@ -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 = abstractSoneCommand.getOptionalSone(soneFieldSet, "RealSone"); + assertThat(sone, notNullValue()); + assertThat(sone.isPresent(), is(false)); } @Test -- 2.7.4