private static UserOperationLogEntry createUserOperationLogEntry() { UserOperationLogEntry entry = mock(UserOperationLogEntry.class); when(entry.getId()).thenReturn(EXAMPLE_USER_OPERATION_LOG_ID); when(entry.getDeploymentId()).thenReturn(EXAMPLE_DEPLOYMENT_ID); when(entry.getProcessDefinitionId()).thenReturn(EXAMPLE_PROCESS_DEFINITION_ID); when(entry.getProcessDefinitionKey()).thenReturn(EXAMPLE_PROCESS_DEFINITION_KEY); when(entry.getProcessInstanceId()).thenReturn(EXAMPLE_PROCESS_INSTANCE_ID); when(entry.getExecutionId()).thenReturn(EXAMPLE_EXECUTION_ID); when(entry.getCaseDefinitionId()).thenReturn(EXAMPLE_CASE_DEFINITION_ID); when(entry.getCaseInstanceId()).thenReturn(EXAMPLE_CASE_INSTANCE_ID); when(entry.getCaseExecutionId()).thenReturn(EXAMPLE_CASE_EXECUTION_ID); when(entry.getTaskId()).thenReturn(EXAMPLE_TASK_ID); when(entry.getJobId()).thenReturn(EXAMPLE_JOB_ID); when(entry.getJobDefinitionId()).thenReturn(EXAMPLE_JOB_DEFINITION_ID); when(entry.getBatchId()).thenReturn(EXAMPLE_BATCH_ID); when(entry.getUserId()).thenReturn(EXAMPLE_USER_ID); when(entry.getTimestamp()).thenReturn(DateTimeUtil.parseDate(EXAMPLE_USER_OPERATION_TIMESTAMP)); when(entry.getOperationId()).thenReturn(EXAMPLE_USER_OPERATION_ID); when(entry.getOperationType()).thenReturn(EXAMPLE_USER_OPERATION_TYPE); when(entry.getEntityType()).thenReturn(EXAMPLE_USER_OPERATION_ENTITY); when(entry.getProperty()).thenReturn(EXAMPLE_USER_OPERATION_PROPERTY); when(entry.getOrgValue()).thenReturn(EXAMPLE_USER_OPERATION_ORG_VALUE); when(entry.getNewValue()).thenReturn(EXAMPLE_USER_OPERATION_NEW_VALUE); return entry; }
public static UserOperationLogEntryDto map(UserOperationLogEntry entry) { UserOperationLogEntryDto dto = new UserOperationLogEntryDto(); dto.id = entry.getId(); dto.deploymentId = entry.getDeploymentId(); dto.processDefinitionId = entry.getProcessDefinitionId(); dto.processDefinitionKey = entry.getProcessDefinitionKey(); dto.processInstanceId = entry.getProcessInstanceId(); dto.executionId = entry.getExecutionId(); dto.caseDefinitionId = entry.getCaseDefinitionId(); dto.caseInstanceId = entry.getCaseInstanceId(); dto.caseExecutionId = entry.getCaseExecutionId(); dto.taskId = entry.getTaskId(); dto.jobId = entry.getJobId(); dto.jobDefinitionId = entry.getJobDefinitionId(); dto.batchId = entry.getBatchId(); dto.userId = entry.getUserId(); dto.timestamp = entry.getTimestamp(); dto.operationId = entry.getOperationId(); dto.operationType = entry.getOperationType(); dto.entityType = entry.getEntityType(); dto.property = entry.getProperty(); dto.orgValue = entry.getOrgValue(); dto.newValue = entry.getNewValue(); dto.removalTime = entry.getRemovalTime(); dto.rootProcessInstanceId = entry.getRootProcessInstanceId(); return dto; }
public static UserOperationLogEntryDto map(UserOperationLogEntry entry) { UserOperationLogEntryDto dto = new UserOperationLogEntryDto(); dto.id = entry.getId(); dto.deploymentId = entry.getDeploymentId(); dto.processDefinitionId = entry.getProcessDefinitionId(); dto.processDefinitionKey = entry.getProcessDefinitionKey(); dto.processInstanceId = entry.getProcessInstanceId(); dto.executionId = entry.getExecutionId(); dto.caseDefinitionId = entry.getCaseDefinitionId(); dto.caseInstanceId = entry.getCaseInstanceId(); dto.caseExecutionId = entry.getCaseExecutionId(); dto.taskId = entry.getTaskId(); dto.jobId = entry.getJobId(); dto.jobDefinitionId = entry.getJobDefinitionId(); dto.batchId = entry.getBatchId(); dto.userId = entry.getUserId(); dto.timestamp = entry.getTimestamp(); dto.operationId = entry.getOperationId(); dto.operationType = entry.getOperationType(); dto.entityType = entry.getEntityType(); dto.property = entry.getProperty(); dto.orgValue = entry.getOrgValue(); dto.newValue = entry.getNewValue(); dto.removalTime = entry.getRemovalTime(); dto.rootProcessInstanceId = entry.getRootProcessInstanceId(); return dto; }
@Test @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) public void shouldCreateUserOperationLogForBatchSuspension() { // given Batch batch = helper.migrateProcessInstancesAsync(1); // when identityService.setAuthenticatedUserId(USER_ID); managementService.suspendBatchById(batch.getId()); identityService.clearAuthentication(); // then UserOperationLogEntry entry = historyService.createUserOperationLogQuery() .singleResult(); assertNotNull(entry); assertEquals(batch.getId(), entry.getBatchId()); assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty()); assertNull(entry.getOrgValue()); assertEquals(SuspensionState.SUSPENDED.getName(), entry.getNewValue()); }
@Test @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) public void shouldCreateUserOperationLogForBatchActivation() { // given Batch batch = helper.migrateProcessInstancesAsync(1); managementService.suspendBatchById(batch.getId()); // when identityService.setAuthenticatedUserId(USER_ID); managementService.activateBatchById(batch.getId()); identityService.clearAuthentication(); // then UserOperationLogEntry entry = historyService.createUserOperationLogQuery() .singleResult(); assertNotNull(entry); assertEquals(batch.getId(), entry.getBatchId()); assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty()); assertNull(entry.getOrgValue()); assertEquals(SuspensionState.ACTIVE.getName(), entry.getNewValue()); }
public static UserOperationLogEntryDto map(UserOperationLogEntry entry) { UserOperationLogEntryDto dto = new UserOperationLogEntryDto(); dto.id = entry.getId(); dto.deploymentId = entry.getDeploymentId(); dto.processDefinitionId = entry.getProcessDefinitionId(); dto.processDefinitionKey = entry.getProcessDefinitionKey(); dto.processInstanceId = entry.getProcessInstanceId(); dto.executionId = entry.getExecutionId(); dto.caseDefinitionId = entry.getCaseDefinitionId(); dto.caseInstanceId = entry.getCaseInstanceId(); dto.caseExecutionId = entry.getCaseExecutionId(); dto.taskId = entry.getTaskId(); dto.jobId = entry.getJobId(); dto.jobDefinitionId = entry.getJobDefinitionId(); dto.batchId = entry.getBatchId(); dto.userId = entry.getUserId(); dto.timestamp = entry.getTimestamp(); dto.operationId = entry.getOperationId(); dto.operationType = entry.getOperationType(); dto.entityType = entry.getEntityType(); dto.property = entry.getProperty(); dto.orgValue = entry.getOrgValue(); dto.newValue = entry.getNewValue(); dto.removalTime = entry.getRemovalTime(); dto.rootProcessInstanceId = entry.getRootProcessInstanceId(); return dto; }
@Test @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) public void shouldCreateUserOperationLogForBatchSuspension() { // given Batch batch = helper.migrateProcessInstancesAsync(1); // when identityService.setAuthenticatedUserId(USER_ID); managementService.suspendBatchById(batch.getId()); identityService.clearAuthentication(); // then UserOperationLogEntry entry = historyService.createUserOperationLogQuery() .singleResult(); assertNotNull(entry); assertEquals(batch.getId(), entry.getBatchId()); assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty()); assertNull(entry.getOrgValue()); assertEquals(SuspensionState.SUSPENDED.getName(), entry.getNewValue()); }
@Test @RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL) public void shouldCreateUserOperationLogForBatchActivation() { // given Batch batch = helper.migrateProcessInstancesAsync(1); managementService.suspendBatchById(batch.getId()); // when identityService.setAuthenticatedUserId(USER_ID); managementService.activateBatchById(batch.getId()); identityService.clearAuthentication(); // then UserOperationLogEntry entry = historyService.createUserOperationLogQuery() .singleResult(); assertNotNull(entry); assertEquals(batch.getId(), entry.getBatchId()); assertEquals(AbstractSetBatchStateCmd.SUSPENSION_STATE_PROPERTY, entry.getProperty()); assertNull(entry.getOrgValue()); assertEquals(SuspensionState.ACTIVE.getName(), entry.getNewValue()); }