@@ -0,0 +1,2637 @@
+package org.sagebionetworks.repo.manager.discussion;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.util.UUID;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.sagebionetworks.repo.manager.NodeManager;%0Aimport org.sagebionetworks.repo.manager.UserManager;%0Aimport org.sagebionetworks.repo.model.DomainType;%0Aimport org.sagebionetworks.repo.model.EntityType;%0Aimport org.sagebionetworks.repo.model.Node;%0Aimport org.sagebionetworks.repo.model.UserInfo;%0Aimport org.sagebionetworks.repo.model.AuthorizationConstants.BOOTSTRAP_PRINCIPAL;%0Aimport org.sagebionetworks.repo.model.auth.NewUser;%0Aimport org.sagebionetworks.repo.model.dbo.persistence.DBOCredential;%0Aimport org.sagebionetworks.repo.model.dbo.persistence.DBOTermsOfUseAgreement;%0Aimport org.sagebionetworks.repo.model.discussion.Forum;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.junit4.SpringJUnit4ClassRunner;%0A%0A@RunWith(SpringJUnit4ClassRunner.class)%0A@ContextConfiguration(locations = %7B %22classpath:test-context.xml%22 %7D)%0Apublic class ForumManagerImplAutowiredTest %7B%0A%09@Autowired%0A%09public NodeManager nodeManager;%0A%09@Autowired%0A%09public UserManager userManager;%0A%09@Autowired%0A%09public ForumManager forumManager;%0A%0A%09private UserInfo adminUserInfo;%0A%09private UserInfo userInfo;%0A%09private String projectId;%0A%0A%09@Before%0A%09public void before() %7B%0A%09%09DBOTermsOfUseAgreement tou = new DBOTermsOfUseAgreement();%0A%09%09tou.setDomain(DomainType.SYNAPSE);%0A%09%09tou.setAgreesToTermsOfUse(Boolean.TRUE);%0A%0A%09%09adminUserInfo = userManager.getUserInfo(BOOTSTRAP_PRINCIPAL.THE_ADMIN_USER.getPrincipalId());%0A%09%09UserInfo.validateUserInfo(adminUserInfo);%0A%0A%09%09DBOCredential cred = new DBOCredential();%0A%09%09cred.setSecretKey(%22%22);%0A%09%09NewUser nu = new NewUser();%0A%09%09nu.setEmail(UUID.randomUUID().toString() + %22@test.com%22);%0A%09%09nu.setUserName(UUID.randomUUID().toString());%0A%09%09userInfo = userManager.createUser(adminUserInfo, nu, cred, tou);%0A%09%09userInfo.getGroups().add(BOOTSTRAP_PRINCIPAL.CERTIFIED_USERS.getPrincipalId());%0A%0A%09%09Node newNode = new Node();%0A%09%09newNode.setName(%22project%22);%0A%09%09newNode.setNodeType(EntityType.project);%0A%09%09projectId = nodeManager.createNewNode(newNode, userInfo);%0A%09%7D%0A%0A%09@After%0A%09public void cleanup() %7B%0A%09%09nodeManager.delete(adminUserInfo, projectId);%0A%09%09userManager.deletePrincipal(adminUserInfo, userInfo.getId());%0A%09%7D%0A%0A%09@Test%0A%09public void testGetNonExistingForum() %7B%0A%09%09Forum dto = forumManager.getForumMetadata(userInfo, projectId);%0A%09%09assertNotNull(dto);%0A%09%09assertNotNull(dto.getId());%0A%09%09assertEquals(dto.getProjectId(), projectId);%0A%09%7D%0A%0A%7D%0A

add test