Use a builder-style mocker for post replies, too.
[Sone.git] / src / test / java / net / pterodactylus / sone / fcp / GetPostCommandTest.java
index 09c21ec..d303535 100644 (file)
@@ -52,7 +52,7 @@ public class GetPostCommandTest {
 
        @Test
        public void verifyThatGettingAPostWithoutRepliesAndRecipientWorks() throws FcpException, FSParseException {
-               Sone sone = mocks.mockRemoteSone("SoneId");
+               Sone sone = mocks.mockSone("SoneId").create();
                Post post = preparePostWithoutRecipient(sone);
                SimpleFieldSet getPostFieldSet = new SimpleFieldSetBuilder()
                                .put("Message", "GetPost")
@@ -65,8 +65,8 @@ public class GetPostCommandTest {
 
        @Test
        public void verifyThatGettingAPostWithoutRepliesAndWithRecipientWorks() throws FcpException, FSParseException {
-               Sone sone = mocks.mockRemoteSone("SoneId");
-               Sone otherSone = mocks.mockRemoteSone("OtherSoneId");
+               Sone sone = mocks.mockSone("SoneId").create();
+               Sone otherSone = mocks.mockSone("OtherSoneId").create();
                Post post = preparePostWithRecipient(sone, otherSone);
                SimpleFieldSet getPostFieldSet = new SimpleFieldSetBuilder()
                                .put("Message", "GetPost")
@@ -79,11 +79,11 @@ public class GetPostCommandTest {
 
        @Test
        public void verifyThatGettingAPostWithRepliesWorks() throws FcpException, FSParseException {
-               Sone sone = mocks.mockRemoteSone("SoneId");
+               Sone sone = mocks.mockSone("SoneId").create();
                Post post = preparePostWithoutRecipient(sone);
-               PostReply postReply1 = mocks.mockPostReply(sone, "Reply1");
+               PostReply postReply1 = mocks.mockPostReply(sone, "Reply1").create();
                when(postReply1.getText()).thenReturn("Reply 1.");
-               PostReply postReply2 = mocks.mockPostReply(sone, "Reply2");
+               PostReply postReply2 = mocks.mockPostReply(sone, "Reply2").create();
                when(postReply2.getText()).thenReturn("Reply 2.");
                when(post.getReplies()).thenReturn(asList(postReply1, postReply2));
                SimpleFieldSet getPostFieldSet = new SimpleFieldSetBuilder()
@@ -132,7 +132,7 @@ public class GetPostCommandTest {
        }
 
        private Post preparePost(Sone sone) {
-               Post post = mocks.mockPost(sone, "PostId");
+               Post post = mocks.mockPost(sone, "PostId").create();
                when(post.getText()).thenReturn("Text of the post.");
                when(post.getTime()).thenReturn(1000L);
                return post;