X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FDeleteReplyCommandTest.java;h=7a30808e4627775ad84b227e35e9ea1ea44bd2f1;hb=67d172414f70c588e878c64ec8ba43f388bc93bb;hp=8b7cadd503f9f27679cf050cbfc7889c3ffa8119;hpb=479f6b7187938eb68d2f00d9e10394ceeb18e0c5;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/fcp/DeleteReplyCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/DeleteReplyCommandTest.java index 8b7cadd..7a30808 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/DeleteReplyCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/DeleteReplyCommandTest.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,10 +57,8 @@ public class DeleteReplyCommandTest { .put("Reply", "ReplyId") .get(); Response response = deleteReplyCommand.execute(deleteReplyFieldSet, null, DIRECT); - assertThat(response, notNullValue()); + verifyAnswer(response, "ReplyDeleted"); assertThat(postReplyCaptor.getValue(), is(postReply)); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("ReplyDeleted")); } @Test(expected = FcpException.class) @@ -89,9 +87,7 @@ public class DeleteReplyCommandTest { .put("Reply", "ReplyId") .get(); Response response = deleteReplyCommand.execute(deleteReplyFieldSet, 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")); }