DiscussionServiceImpl implements DiscussionService { @Override public TopicInfo createTopic(final String siteShortName, final String title) { NodeRef container = getSiteDiscussionsContainer(siteShortName, true); return createTopic(container, title); }  void setNodeDAO(NodeDAO nodeDAO); void setNodeService(NodeService nodeService); void setSiteService(SiteService siteService); void setSearchService(SearchService searchService); void setContentService(ContentService contentService); void setTaggingService(TaggingService taggingService); void setNamespaceService(NamespaceService namespaceService); void setFileFolderService(FileFolderService fileFolderService); void setTransactionService(TransactionService transactionService); void setCannedQueryRegistry(NamedObjectRegistry<CannedQueryFactory<? extends Object>> cannedQueryRegistry); @Override TopicInfo getTopic(String siteShortName, String topicName); @Override TopicInfo getTopic(NodeRef parentNodeRef, String topicName); @Override PostInfo getPost(TopicInfo topic, String postName); @Override TopicInfo createTopic(final String siteShortName, final String title); @Override TopicInfo createTopic(final NodeRef parentNodeRef, final String title); @Override PostInfo createPost(TopicInfo topic, String contents); @Override PostInfo createReply(PostInfo parentPost, String contents); @Override TopicInfo updateTopic(TopicInfo topic); @Override PostInfo updatePost(PostInfo post); @Override void deleteTopic(TopicInfo topic); @Override void deletePost(PostInfo post); @Override Pair<TopicInfo,PostInfo> getForNodeRef(NodeRef nodeRef); @Override PostInfo getPrimaryPost(TopicInfo topic); @Override PostInfo getMostRecentPost(TopicInfo topic); @Override PagingResults<TopicInfo> listTopics(String siteShortName,
         boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> listTopics(NodeRef nodeRef,
         boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> listTopics(String siteShortName,
         String username, boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> listTopics(NodeRef nodeRef,
         String username, boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> listTopics(String siteShortName,
         Date from, Date to, boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> listTopics(NodeRef nodeRef,
         Date from, Date to, boolean sortAscending, PagingRequest paging); @Override PagingResults<Pair<TopicInfo, Integer>> listHotTopics(
         String siteShortName, Date since, PagingRequest paging); @Override PagingResults<Pair<TopicInfo, Integer>> listHotTopics(
         NodeRef nodeRef, Date since, PagingRequest paging); @Override PagingResults<TopicInfo> findTopics(String siteShortName,
         String username, String tag, boolean sortAscending, PagingRequest paging); @Override PagingResults<TopicInfo> findTopics(NodeRef nodeRef,
         String username, String tag, boolean sortAscending, PagingRequest paging); @Override PagingResults<PostInfo> listPosts(TopicInfo topic, PagingRequest paging); @Override PostWithReplies listPostReplies(TopicInfo topic, int levels); @Override PostWithReplies listPostReplies(PostInfo primaryPost, int levels); static final String DISCUSSION_COMPONENT; }
@Test public void newContainerSetup() throws Exception { final String TEST_SITE_NAME = "DiscussionsTestNewTestSite"; TRANSACTION_HELPER.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { if (SITE_SERVICE.getSite(TEST_SITE_NAME) != null) { SITE_SERVICE.deleteSite(TEST_SITE_NAME); } SITE_SERVICE.createSite( TEST_SITE_PREFIX, TEST_SITE_NAME, "Test", "Test", SiteVisibility.PUBLIC); assertFalse(SITE_SERVICE.hasContainer(TEST_SITE_NAME, DiscussionServiceImpl.DISCUSSION_COMPONENT)); DISCUSSION_SERVICE.createTopic(TEST_SITE_NAME, "Title"); assertTrue(SITE_SERVICE.hasContainer(TEST_SITE_NAME, DiscussionServiceImpl.DISCUSSION_COMPONENT)); NodeRef container = SITE_SERVICE.getContainer(TEST_SITE_NAME, DiscussionServiceImpl.DISCUSSION_COMPONENT); assertTrue(TAGGING_SERVICE.isTagScope(container)); SITE_SERVICE.deleteSite(TEST_SITE_NAME); return null; } }); }