X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffcp%2FGetPostFeedCommandTest.java;h=46f21f3b9c1942504fa46abb2a0fe0df5ac79432;hb=2d37242d19f2e726cd402b99f935a0eba282f630;hp=838b03d3bdfe0a9599637dd09e28af20c08fdee6;hpb=2c1a8dbe9f2b08d78b172523bdfecddf9a33a2a8;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/fcp/GetPostFeedCommandTest.java b/src/test/java/net/pterodactylus/sone/fcp/GetPostFeedCommandTest.java index 838b03d..46f21f3 100644 --- a/src/test/java/net/pterodactylus/sone/fcp/GetPostFeedCommandTest.java +++ b/src/test/java/net/pterodactylus/sone/fcp/GetPostFeedCommandTest.java @@ -20,11 +20,9 @@ package net.pterodactylus.sone.fcp; import static java.lang.System.currentTimeMillis; import static java.util.Arrays.asList; import static java.util.concurrent.TimeUnit.DAYS; -import static net.pterodactylus.sone.fcp.Verifiers.verifyPostsWithReplies; +import static net.pterodactylus.sone.Verifiers.verifyAnswer; +import static net.pterodactylus.sone.Verifiers.verifyPostsWithReplies; 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 java.util.Collections; @@ -80,9 +78,7 @@ public class GetPostFeedCommandTest { .put("Sone", "LSone") .get(); Response response = getPostFeedCommand.execute(getPostFeedFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostFeed")); + verifyAnswer(response, "PostFeed"); verifyPostsWithReplies(response.getReplyParameters(), "Posts.", asList(localPost, friendPost, remotePost)); } @@ -94,9 +90,7 @@ public class GetPostFeedCommandTest { .put("StartPost", "1") .get(); Response response = getPostFeedCommand.execute(getPostFeedFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostFeed")); + verifyAnswer(response, "PostFeed"); verifyPostsWithReplies(response.getReplyParameters(), "Posts.", asList(friendPost, remotePost)); } @@ -108,9 +102,7 @@ public class GetPostFeedCommandTest { .put("MaxPosts", "2") .get(); Response response = getPostFeedCommand.execute(getPostFeedFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostFeed")); + verifyAnswer(response, "PostFeed"); verifyPostsWithReplies(response.getReplyParameters(), "Posts.", asList(localPost, friendPost)); } @@ -123,9 +115,7 @@ public class GetPostFeedCommandTest { .put("StartPost", "1") .get(); Response response = getPostFeedCommand.execute(getPostFeedFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostFeed")); + verifyAnswer(response, "PostFeed"); verifyPostsWithReplies(response.getReplyParameters(), "Posts.", asList(friendPost)); } @@ -137,9 +127,7 @@ public class GetPostFeedCommandTest { .put("StartPost", "10") .get(); Response response = getPostFeedCommand.execute(getPostFeedFieldSet, null, DIRECT); - assertThat(response, notNullValue()); - assertThat(response.getReplyParameters(), notNullValue()); - assertThat(response.getReplyParameters().get("Message"), is("PostFeed")); + verifyAnswer(response, "PostFeed"); verifyPostsWithReplies(response.getReplyParameters(), "Posts.", Collections.emptyList()); }