assertEquals(forum.moderator().name(), forumData.getModeratorName());
}
public void testForumDiscussionsDataOfId() throws Exception {
Forum forum = this.forumAggregate();
DomainRegistry.forumRepository().save(forum);
Discussion[] discussions = this.discussionAggregates(forum);
for (Discussion discussion : discussions) {
DomainRegistry.discussionRepository().save(discussion);
}
ForumDiscussionsData forumDiscussionsData =
forumQueryService.forumDiscussionsDataOfId(
forum.tenant().id(), forum.forumId().id());
assertNotNull(forumDiscussionsData);
assertEquals(forum.forumId().id(), forumDiscussionsData.getForumId());
assertEquals(forum.tenant().id(), forumDiscussionsData.getTenantId());
assertEquals(forum.creator().emailAddress(), forumDiscussionsData.getCreatorEmailAddress());
assertEquals(forum.creator().identity(), forumDiscussionsData.getCreatorIdentity());
assertEquals(forum.creator().name(), forumDiscussionsData.getCreatorName());
assertEquals(forum.description(), forumDiscussionsData.getDescription());
assertEquals(forum.exclusiveOwner(), forumDiscussionsData.getExclusiveOwner());
assertEquals(forum.isClosed(), forumDiscussionsData.isClosed());
assertEquals(forum.subject(), forumDiscussionsData.getSubject());
assertEquals(forum.moderator().emailAddress(), forumDiscussionsData.getModeratorEmailAddress());
assertEquals(forum.moderator().identity(), forumDiscussionsData.getModeratorIdentity());
assertEquals(forum.moderator().name(), forumDiscussionsData.getModeratorName());
assertNotNull(forumDiscussionsData.getDiscussions());
assertFalse(forumDiscussionsData.getDiscussions().isEmpty());
assertEquals(3, forumDiscussionsData.getDiscussions().size());
}