assertEquals(exclusiveOwner, newlyStartedForum.exclusiveOwner());
}
public void testStartExclusiveForumWithDiscussion() throws Exception {
Forum forum = this.forumAggregate();
ForumCommandResult result = new ForumCommandResult() {
@Override
public void resultingForumId(String aForumId) {
forumId = aForumId;
}
@Override
public void resultingDiscussionId(String aDiscussionId) {
discussionId = aDiscussionId;
}
};
String exclusiveOwner = UUID.randomUUID().toString().toUpperCase();
forumApplicationService.startExclusiveForumWithDiscussion(
forum.tenant().id(),
exclusiveOwner,
forum.creator().identity(),
forum.moderator().identity(),
"authorId1",
forum.subject(),
forum.description(),
"Discussion Subject",
result);
assertNotNull(this.forumId);
assertNotNull(this.discussionId);
Forum newlyStartedForum =
DomainRegistry
.forumRepository()
.forumOfId(forum.tenant(), new ForumId(this.forumId));
assertNotNull(newlyStartedForum);
assertEquals(forum.tenant(), newlyStartedForum.tenant());
assertEquals(this.forumId, newlyStartedForum.forumId().id());
assertEquals(forum.creator().identity(), newlyStartedForum.creator().identity());
assertEquals(forum.moderator().identity(), newlyStartedForum.moderator().identity());
assertEquals(forum.subject(), newlyStartedForum.subject());
assertEquals(forum.description(), newlyStartedForum.description());
assertEquals(exclusiveOwner, newlyStartedForum.exclusiveOwner());
Discussion newlyStartedDiscussion =
DomainRegistry
.discussionRepository()
.discussionOfId(forum.tenant(), new DiscussionId(this.discussionId));