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;
.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));
}
.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"));
}