ForumServiceImpl implements ForumService { @Override public List<Message> getThread(Long msgid) { return forumDao.getThread(msgid); } ForumServiceImpl();   ForumServiceImpl(ForumDao forumManagerMock); @Override List<Message> getThread(Long msgid); @Override List<Long> getAllForumKeys(); @Override List<Message> getMessagesByForum(final Forum forum); @Override List<Message> getMessagesByForumID(Long forum_id); @Override Integer countMessagesByForumID(Long forumkey); @Override int countReadMessagesByUserAndForum(Identity identity, Long forumkey); @Override List<Message> getNewMessageInfo(Long forumKey, Date latestRead); @Override Forum addAForum(); @Override Forum loadForum(Long forumKey); @Override void deleteForum(Long forumKey); @Override void replyToMessage(Identity creator, Message replyToMessage, Message newMessage, PublishEventTO publishEventTO); @Override void addTopMessage(Forum forum, Message topMessage, Identity creator, PublishEventTO publishEventTO); @Override Message loadMessage(Long messageKey); @Override Message createMessage(); void saveMessage(final Message m); @Override void updateMessage(Identity updater, Message updatedMessage, boolean updateLastModifiedDate, ForumChangedEvent event, PublishEventTO publishEventTO); void updateCounters(final Message m); @Override void deleteMessageTree(Long forumKey, Message m); @Override boolean hasChildren(Message m); @Override OlatRootFolderImpl getMessageContainer(Long forumKey, Long messageKey); @Override Message findMessage(Long messageId); @Override Message splitThread(Identity updater, final Message msg); @Override Message moveMessage(Identity updater, final Message msg, final Message topMsg); @Override Set<Long> getReadSet(Identity identity, Forum forum); @Override void markAsRead(Identity identity, Message msg); OlatRootFolderImpl getForumContainer(final Long forumKey); String getFileSize(final Long forumKey); @Override VFSContainer getForumArchiveContainer(final Identity identity, final Long forumKey); @Override VFSContainer getTempUploadFolder();  }
@Test public void getThreadWithNull() { List<Message> thread = forumService.getThread(null); assertTrue(thread != null); assertTrue(thread.size() == 0); }
@Test public void getThreadWithExisting() { List<Message> thread = forumService.getThread(THREAD_ID_WITH_ONE_MESSAGE); assertTrue(thread != null); assertTrue(thread.size() == 1); assertEquals(oneTopMessage, thread.get(0)); }
@Test public void getThreadWithNotExisting() { List<Message> thread = forumService.getThread(Long.valueOf(123)); assertTrue(thread != null); assertTrue(thread.size() == 0); }