Search in sources :

Example 1 with NamespaceServiceMemoryImpl

use of org.alfresco.service.namespace.NamespaceServiceMemoryImpl in project alfresco-remote-api by Alfresco.

the class WorkflowModelBuilderTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    namespaceService = new NamespaceServiceMemoryImpl();
    namespaceService.registerNamespace("test", URI);
    namespaceService.registerNamespace(NamespaceService.CONTENT_MODEL_PREFIX, NamespaceService.CONTENT_MODEL_1_0_URI);
    namespaceService.registerNamespace(NamespaceService.BPM_MODEL_PREFIX, NamespaceService.BPM_MODEL_1_0_URI);
    personService = mock(PersonService.class);
    when(personService.getPerson(userName)).thenReturn(person);
    when(personService.personExists(userName)).thenReturn(true);
    nodeService = mock(NodeService.class);
    Map<QName, Serializable> personProps = new HashMap<QName, Serializable>();
    personProps.put(ContentModel.PROP_USERNAME, userName);
    personProps.put(ContentModel.PROP_FIRSTNAME, firstName);
    personProps.put(ContentModel.PROP_LASTNAME, lastName);
    when(nodeService.getProperties(person)).thenReturn(personProps);
    when(nodeService.getProperty(person, ContentModel.PROP_USERNAME)).thenReturn(userName);
    when(nodeService.getProperty(person, ContentModel.PROP_FIRSTNAME)).thenReturn(firstName);
    when(nodeService.getProperty(person, ContentModel.PROP_LASTNAME)).thenReturn(lastName);
    workflowService = mock(WorkflowService.class);
    dictionaryService = mock(DictionaryService.class);
    authenticationService = mock(AuthenticationService.class);
    builder = new WorkflowModelBuilder(namespaceService, nodeService, authenticationService, personService, workflowService, dictionaryService);
}
Also used : Serializable(java.io.Serializable) DictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService) HashMap(java.util.HashMap) WorkflowService(org.alfresco.service.cmr.workflow.WorkflowService) QName(org.alfresco.service.namespace.QName) NamespaceServiceMemoryImpl(org.alfresco.service.namespace.NamespaceServiceMemoryImpl) PersonService(org.alfresco.service.cmr.security.PersonService) NodeService(org.alfresco.service.cmr.repository.NodeService) AuthenticationService(org.alfresco.service.cmr.security.AuthenticationService)

Aggregations

Serializable (java.io.Serializable)1 HashMap (java.util.HashMap)1 DictionaryService (org.alfresco.service.cmr.dictionary.DictionaryService)1 NodeService (org.alfresco.service.cmr.repository.NodeService)1 AuthenticationService (org.alfresco.service.cmr.security.AuthenticationService)1 PersonService (org.alfresco.service.cmr.security.PersonService)1 WorkflowService (org.alfresco.service.cmr.workflow.WorkflowService)1 NamespaceServiceMemoryImpl (org.alfresco.service.namespace.NamespaceServiceMemoryImpl)1 QName (org.alfresco.service.namespace.QName)1