X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeletePostCommandTest.java;h=1e2ce7ccfe235821b78a1adc333af92884acd85c;hb=67d172414f70c588e878c64ec8ba43f388bc93bb;hp=21214dbfd133bf978516af0c93cb10d30e0602f5;hpb=d1e15185426a5a66a1d67fd0ba24fcacf17df556;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java index 21214db..1e2ce7c 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java @@ -17,10 +17,10 @@ package net.pterodactylus.sone.fcp; +import static net.pterodactylus.sone.fcp.Verifiers.verifyAnswer; import static net.pterodactylus.sone.freenet.fcp.Command.AccessType.DIRECT; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; -import static org.hamcrest.Matchers.notNullValue; import static org.mockito.ArgumentCaptor.forClass; import static org.mockito.Mockito.doNothing; @@ -57,9 +57,7 @@ public class DeletePostCommandTest { .put("Post", "PostId") .get(); Response response = deletePostCommand.execute(deletePostFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostDeleted")); + verifyAnswer(response, "PostDeleted"); assertThat(deletedPost.getValue(), is(post)); } @@ -72,9 +70,7 @@ public class DeletePostCommandTest { .put("Post", "PostId") .get(); Response response = deletePostCommand.execute(deletePostFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("Error")); + verifyAnswer(response, "Error"); assertThat(response.getReplyParameters().get("ErrorCode"), is("401")); }