assertNotNull(currentUser);
ForumPost fp = new SchoolForumPost(sc, currentUser, TITLE, TEXT,
null);
executeWithToken(new SaveForumPostCommand(fp), false);
PostsList posts = schoolService.getForum(sc, 0, 10);
assertEquals(1, posts.getTotalCount());
assertEquals(1, posts.getPosts().size());
ForumPost saved = posts.getPosts().get(0);
assertNotNull(saved);
assertEquals(SchoolForumPost.class, saved.getClass());
assertTrue(saved.getId() > 0);
assertEquals(TITLE, saved.getPostTitle());
assertEquals(TEXT, saved.getPostString());
assertEquals(0, saved.getReplyCount());
assertEquals(null, saved.getThreadPost());
assertEquals(currentUser, saved.getAuthor());
// save a second post to the same thread
ForumPost fp2 = new SchoolForumPost(sc, currentUser, TITLE, TEXT,
saved);
executeWithToken(new SaveForumPostCommand(fp2), false);
// assert that there's still just 1 top level thread
posts = schoolService.getForum(sc, 0, 10);
assertEquals(1, posts.getTotalCount());
assertEquals(1, posts.getPosts().size());