Exemplo n.º 1
0
        public virtual void testInvalidGroupQueryTaskCandidateForAddAndDeleteIdentityLink()
        {
            IList <HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();

            assertEquals(historicIdentityLinks.Count, 0);

            // given
            startProcessInstance(PROCESS_DEFINITION_KEY);
            string taskId = taskService.createTaskQuery().singleResult().Id;

            // if
            identityService.AuthenticatedUserId = A_ASSIGNER_ID;
            taskService.addCandidateUser(taskId, A_USER_ID);
            taskService.deleteCandidateUser(taskId, A_USER_ID);

            // Invalid Individual Query test
            HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();

            assertEquals(query.taskId(INVALID_TASK_ID).count(), 0);
            assertEquals(query.type(INVALID_IDENTITY_LINK_TYPE).count(), 0);
            assertEquals(query.userId(INVALID_USER_ID).count(), 0);
            assertEquals(query.groupId(INVALID_GROUP_ID).count(), 0);
            assertEquals(query.assignerId(INVALID_ASSIGNER_ID).count(), 0);
            assertEquals(query.operationType(INVALID_HISTORY_EVENT_TYPE).count(), 0);
            assertEquals(query.processDefinitionId(INVALID_PROCESS_DEFINITION_ID).count(), 0);
            assertEquals(query.processDefinitionKey(INVALID_PROCESS_DEFINITION_KEY).count(), 0);
        }
Exemplo n.º 2
0
        public virtual void testValidGroupQueryTaskCandidateForAddAndDeleteIdentityLink()
        {
            IList <HistoricIdentityLinkLog> historicIdentityLinks = historyService.createHistoricIdentityLinkLogQuery().list();

            assertEquals(historicIdentityLinks.Count, 0);

            // given
            ProcessInstance processInstance = startProcessInstance(PROCESS_DEFINITION_KEY);
            string          taskId          = taskService.createTaskQuery().singleResult().Id;

            // if
            identityService.AuthenticatedUserId = A_ASSIGNER_ID;
            taskService.addCandidateUser(taskId, A_USER_ID);
            taskService.deleteCandidateUser(taskId, A_USER_ID);

            // Valid group query test
            HistoricIdentityLinkLogQuery query = historyService.createHistoricIdentityLinkLogQuery();

            assertEquals(query.taskId(taskId).count(), 2);
            assertEquals(query.type(IdentityLinkType.CANDIDATE).count(), 2);
            assertEquals(query.userId(A_USER_ID).count(), 2);
            assertEquals(query.assignerId(A_ASSIGNER_ID).count(), 2);
            assertEquals(query.processDefinitionId(processInstance.ProcessDefinitionId).count(), 2);
            assertEquals(query.processDefinitionKey(PROCESS_DEFINITION_KEY).count(), 2);
            assertEquals(query.operationType(IDENTITY_LINK_DELETE).count(), 1);
            assertEquals(query.operationType(IDENTITY_LINK_ADD).count(), 1);
        }