X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeletePostCommandTest.java;h=683864c20968e692d7e58d9ab151b8f6a7705790;hp=21214dbfd133bf978516af0c93cb10d30e0602f5;hb=2d37242d19f2e726cd402b99f935a0eba282f630;hpb=1be3820cd48951abbcfd5a7f95b82d44aa0e016a diff --git a/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/DeletePostCommandTest.java index 21214db..683864c 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.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")); }