Package com.saasovation.collaboration.domain.model.forum

Examples of com.saasovation.collaboration.domain.model.forum.Post


                    "authorId1",
                    "Post Test",
                    "Post test text...",
                    result);

        Post post =
                DomainRegistry
                    .postRepository()
                    .postOfId(
                            discussion.tenant(),
                            new PostId(postId));

        assertNotNull(discussionId);
        assertNotNull(post);
        assertEquals("authorId1", post.author().identity());
        assertEquals("Post Test", post.subject());
        assertEquals("Post test text...", post.bodyText());
    }
View Full Code Here


                "authorId2",
                "Post In Reply To Test",
                "Post test text in reply to...",
                result);

        Post postedInReplyTo =
                DomainRegistry
                    .postRepository()
                    .postOfId(
                            discussion.tenant(),
                            new PostId(postId));

        assertNotNull(discussionId);
        assertNotNull(inReplyToPostId);
        assertNotNull(postedInReplyTo);
        assertEquals("authorId2", postedInReplyTo.author().identity());
        assertEquals("Post In Reply To Test", postedInReplyTo.subject());
        assertEquals("Post test text in reply to...", postedInReplyTo.bodyText());
    }
View Full Code Here

        return new Forum[] { forum1, forum2, forum3 };
    }

    protected Post postAggregate(Discussion aDiscussion) {

        Post post = aDiscussion.post(
                DomainRegistry.forumIdentityService(),
                new Author("jdoe", "John Doe", "jdoe@saasovation.com"),
                "I Am All About DDD",
                "That's what I'm talk'n about.");
View Full Code Here

        return post;
    }

    protected Post[] postAggregates(Discussion aDiscussion) {

        Post post1 = aDiscussion.post(
                DomainRegistry.forumIdentityService(),
                new Author("jdoe", "John Doe", "jdoe@saasovation.com"),
                "I Am All About DDD",
                "That's what I'm talk'n about.");

        Post post2 = aDiscussion.post(
                DomainRegistry.forumIdentityService(),
                new Author("zoe", "Zoe Doe", "zoe@saasovation.com"),
                "RE: I Am All About DDD",
                "No, no, no. That's what *I'm* talk'n about.");

        Post post3 = aDiscussion.post(
                DomainRegistry.forumIdentityService(),
                new Author("joe", "Joe Smith", "joe@saasovation.com"),
                "RE: I Am All About DDD",
                "Did I mention that I've forgotten more than you will ever know?");

View Full Code Here

        DomainRegistry.forumRepository().save(forum);

        Discussion discussion = this.discussionAggregate(forum);
        DomainRegistry.discussionRepository().save(discussion);

        Post post = this.postAggregate(discussion);
        DomainRegistry.postRepository().save(post);

        PostData postData =
                postQueryService.postDataOfId(
                        post.tenant().id(), post.postId().id());

        assertNotNull(postData);
        assertEquals(post.postId().id(), postData.getPostId());
        assertEquals(post.discussionId().id(), postData.getDiscussionId());
        assertEquals(post.forumId().id(), postData.getForumId());
        assertEquals(post.tenant().id(), postData.getTenantId());
        assertEquals(post.author().emailAddress(), postData.getAuthorEmailAddress());
        assertEquals(post.author().identity(), postData.getAuthorIdentity());
        assertEquals(post.author().name(), postData.getAuthorName());
        // assertEquals(post.changedOn(), postData.getChangedOn());
        // assertEquals(post.createdOn(), postData.getCreatedOn());
        assertEquals(post.subject(), postData.getSubject());
        assertEquals(post.bodyText(), postData.getBodyText());

        if (postData.getReplyToPostId() == null) {
            assertEquals(post.replyToPostId(), postData.getReplyToPostId());
        } else {
            assertEquals(post.replyToPostId().id(), postData.getReplyToPostId());
        }
    }
View Full Code Here

                            new ForumId(aForumId));

        Moderator moderator =
                this.collaboratorService().moderatorFrom(tenant, aModeratorId);

        Post post = this.postRepository().postOfId(tenant, new PostId(aPostId));

        forum.moderatePost(post, moderator, aSubject, aBodyText);

        this.postRepository().save(post);
    }
View Full Code Here

        EventStreamId eventId = new EventStreamId(aTenantId.id(), aPostId.id());

        EventStream eventStream = this.eventStore().eventStreamSince(eventId);

        Post Post = new Post(eventStream.events(), eventStream.version());

        return Post;
    }
View Full Code Here

                postId,
                forum.moderator().identity(),
                "Post Moderated Subject Test",
                "Post moderated text test...");

        Post post =
                DomainRegistry
                    .postRepository()
                    .postOfId(
                            discussion.tenant(),
                            new PostId(postId));

        assertNotNull(discussionId);
        assertNotNull(post);
        assertEquals("Post Moderated Subject Test", post.subject());
        assertEquals("Post moderated text test...", post.bodyText());
    }
View Full Code Here

                            new DiscussionId(aDiscussionId));

        Author author =
                this.collaboratorService().authorFrom(new Tenant(aTenantId), anAuthorId);

        Post post = discussion.post(this.forumIdentityService(), author, aSubject, aBodyText);

        this.postRepository().save(post);

        aDiscussionCommandResult.resultingDiscussionId(aDiscussionId);
        aDiscussionCommandResult.resultingPostId(post.postId().id());
    }
View Full Code Here

                            new DiscussionId(aDiscussionId));

        Author author =
                this.collaboratorService().authorFrom(new Tenant(aTenantId), anAuthorId);

        Post post =
                discussion.post(
                        this.forumIdentityService(),
                        new PostId(aReplyToPostId),
                        author,
                        aSubject,
                        aBodyText);

        this.postRepository().save(post);

        aDiscussionCommandResult.resultingDiscussionId(aDiscussionId);
        aDiscussionCommandResult.resultingPostId(post.postId().id());
        aDiscussionCommandResult.resultingInReplyToPostId(aReplyToPostId);
    }
View Full Code Here

TOP

Related Classes of com.saasovation.collaboration.domain.model.forum.Post

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.