import static com.google.common.base.Optional.of;
import static java.lang.String.format;
import static java.util.Arrays.asList;
+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.Mockito.when;
import net.pterodactylus.sone.data.Mocks;
return post;
}
- private void verifyAnswer(Response response, String messageName) {
- assertThat(response, notNullValue());
- assertThat(response.getReplyParameters(), notNullValue());
- assertThat(response.getReplyParameters().get("Message"), is(messageName));
- }
-
private void verifyReply(SimpleFieldSet replyParameters, String prefix, PostReply postReply) throws FSParseException {
assertThat(replyParameters.get(format("%sID", prefix)), is(postReply.getId()));
assertThat(replyParameters.get(format("%sSone", prefix)), is(postReply.getSone().getId()));
import static net.pterodactylus.sone.data.Reply.FUTURE_REPLY_FILTER;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.notNullValue;
import java.util.Collection;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.PostReply;
+import net.pterodactylus.sone.freenet.fcp.Command.Response;
import freenet.node.FSParseException;
import freenet.support.SimpleFieldSet;
*/
public class Verifiers {
+ static void verifyAnswer(Response response, String messageName) {
+ assertThat(response, notNullValue());
+ assertThat(response.getReplyParameters(), notNullValue());
+ assertThat(response.getReplyParameters().get("Message"), is(messageName));
+ }
+
static void verifyPost(SimpleFieldSet replyParameters, String prefix, Post post) throws FSParseException {
assertThat(replyParameters.get(format("%sID", prefix)), is(post.getId()));
assertThat(replyParameters.get(format("%sSone", prefix)), is(post.getSone().getId()));