Move name of message into method parameter.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 30 Oct 2013 21:23:16 +0000 (22:23 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:25:51 +0000 (22:25 +0100)
src/test/java/net/pterodactylus/sone/fcp/GetPostCommandTest.java

index d303535..2c72cdf 100644 (file)
@@ -59,7 +59,7 @@ public class GetPostCommandTest {
                                .put("Post", "PostId")
                                .get();
                Response response = getPostCommand.execute(getPostFieldSet, null, DIRECT);
-               verifyAnswer(response);
+               verifyAnswer(response, "Post");
                verifyPost(post, response);
        }
 
@@ -73,7 +73,7 @@ public class GetPostCommandTest {
                                .put("Post", "PostId")
                                .get();
                Response response = getPostCommand.execute(getPostFieldSet, null, DIRECT);
-               verifyAnswer(response);
+               verifyAnswer(response, "Post");
                verifyPost(post, response);
        }
 
@@ -92,7 +92,7 @@ public class GetPostCommandTest {
                                .put("IncludeReplies", "true")
                                .get();
                Response response = getPostCommand.execute(getPostFieldSet, null, DIRECT);
-               verifyAnswer(response);
+               verifyAnswer(response, "Post");
                verifyPost(post, response);
                assertThat(response.getReplyParameters().getInt("Post.Replies.Count"), is(post.getReplies().size()));
                verifyReply(response.getReplyParameters(), "Post.Replies.0.", postReply1);
@@ -138,10 +138,10 @@ public class GetPostCommandTest {
                return post;
        }
 
-       private void verifyAnswer(Response response) {
+       private void verifyAnswer(Response response, String messageName) {
                assertThat(response, notNullValue());
                assertThat(response.getReplyParameters(), notNullValue());
-               assertThat(response.getReplyParameters().get("Message"), is("Post"));
+               assertThat(response.getReplyParameters().get("Message"), is(messageName));
        }
 
        private void verifyReply(SimpleFieldSet replyParameters, String prefix, PostReply postReply) throws FSParseException {