use of org.alfresco.repo.security.person.TestGroupManager in project alfresco-remote-api by Alfresco.
the class AbstractWorkflowRestApiTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
ApplicationContext appContext = getServer().getApplicationContext();
namespaceService = (NamespaceService) appContext.getBean("NamespaceService");
workflowService = (WorkflowService) appContext.getBean("WorkflowService");
MutableAuthenticationService authenticationService = (MutableAuthenticationService) appContext.getBean("AuthenticationService");
PersonService personService = (PersonService) appContext.getBean("PersonService");
SearchService searchService = (SearchService) appContext.getBean("SearchService");
FileFolderService fileFolderService = (FileFolderService) appContext.getBean("FileFolderService");
nodeService = (NodeService) appContext.getBean("NodeService");
// for the purposes of the tests make sure workflow engine is enabled/visible.
WorkflowAdminServiceImpl workflowAdminService = (WorkflowAdminServiceImpl) appContext.getBean("workflowAdminService");
this.wfTestHelper = new WorkflowTestHelper(workflowAdminService, getEngine(), true);
AuthorityService authorityService = (AuthorityService) appContext.getBean("AuthorityService");
personManager = new TestPersonManager(authenticationService, personService, nodeService);
groupManager = new TestGroupManager(authorityService);
authenticationComponent = (AuthenticationComponent) appContext.getBean("authenticationComponent");
dictionaryService = (DictionaryService) appContext.getBean("dictionaryService");
personManager.createPerson(USER1);
personManager.createPerson(USER2);
personManager.createPerson(USER3);
authenticationComponent.setSystemUserAsCurrentUser();
groupManager.addUserToGroup(GROUP, USER2);
packageRef = workflowService.createPackage(null);
NodeRef companyHome = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE), COMPANY_HOME, null, namespaceService, false).get(0);
contentNodeRef = fileFolderService.create(companyHome, TEST_CONTENT + System.currentTimeMillis(), ContentModel.TYPE_CONTENT).getNodeRef();
authenticationComponent.clearCurrentSecurityContext();
}
Aggregations