private void verifySameOperationId(List<UserOperationLogEntry> userOperationLogEntries, List<HistoricDetail> historicDetails) { assertTrue("Operation log entry must exist", userOperationLogEntries.size() > 0); String operationId = userOperationLogEntries.get(0).getOperationId(); assertNotNull(operationId); assertTrue("Some historic details are expected to be present", historicDetails.size() > 0); for (UserOperationLogEntry userOperationLogEntry: userOperationLogEntries) { assertEquals("OperationIds must be the same", operationId, userOperationLogEntry.getOperationId()); } for (HistoricDetail historicDetail : historicDetails) { assertEquals("OperationIds must be the same", operationId, historicDetail.getUserOperationId()); } }
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 void testCompositeBeanInteraction() { // given: a manually created task task = taskService.newTask(); // then: save the task without any property change taskService.saveTask(task); // expect: no entry UserOperationLogQuery query = queryOperationDetails(OPERATION_TYPE_CREATE); UserOperationLogEntry create = query.singleResult(); assertNotNull(create); assertEquals(ENTITY_TYPE_TASK, create.getEntityType()); assertNull(create.getOrgValue()); assertNull(create.getNewValue()); assertNull(create.getProperty()); task.setAssignee("icke"); task.setName("to do"); // then: save the task again taskService.saveTask(task); // expect: two update entries with the same operation id List<UserOperationLogEntry> entries = queryOperationDetails(OPERATION_TYPE_UPDATE).list(); assertEquals(2, entries.size()); assertEquals(entries.get(0).getOperationId(), entries.get(1).getOperationId()); }
assertEquals("a-delete-reason", deleteReasonEntry.getNewValue()); assertEquals(typeEntry.getOperationId(), asyncEntry.getOperationId()); assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId()); assertEquals(numInstancesEntry.getOperationId(), deleteReasonEntry.getOperationId());
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; }
assertEquals("a-delete-reason", deleteReasonEntry.getNewValue()); assertEquals(typeEntry.getOperationId(), asyncEntry.getOperationId()); assertEquals(asyncEntry.getOperationId(), deleteReasonEntry.getOperationId()); assertEquals(numInstancesEntry.getOperationId(), deleteReasonEntry.getOperationId());
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; }
assertEquals("a-delete-reason", deleteReasonEntry.getNewValue()); assertEquals(typeEntry.getOperationId(), asyncEntry.getOperationId()); assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId()); assertEquals(numInstancesEntry.getOperationId(), deleteReasonEntry.getOperationId());
assertEquals("2", numInstancesEntry.getNewValue()); assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId());
Assert.assertNull(retriesEntry.getOrgValue()); Assert.assertEquals("5", retriesEntry.getNewValue()); Assert.assertEquals(asyncEntry.getOperationId(), retriesEntry.getOperationId());
Assert.assertEquals("10", numInstancesEntry.getNewValue()); Assert.assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId());
Assert.assertEquals("1", numInstancesEntry.getNewValue()); Assert.assertEquals(procDefEntry.getOperationId(), asyncEntry.getOperationId()); Assert.assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId());
Assert.assertEquals("1", numInstanceEntry.getNewValue()); Assert.assertEquals(procDefEntry.getOperationId(), asyncEntry.getOperationId()); Assert.assertEquals(asyncEntry.getOperationId(), numInstanceEntry.getOperationId());
assertEquals(logDuplicateFilterEnabledProperty.getOperationId(), logDeployChangedOnlyProperty.getOperationId());
assertEquals(logDuplicateFilterEnabledProperty.getOperationId(), logDeployChangedOnlyProperty.getOperationId());
Assert.assertNull(retriesEntry.getOrgValue()); Assert.assertEquals("5", retriesEntry.getNewValue()); Assert.assertEquals(asyncEntry.getOperationId(), retriesEntry.getOperationId());
String updateOperationId = updates.list().get(0).getOperationId(); assertEquals(updates.count(), query().operationId(updateOperationId).count());
Assert.assertEquals("2", numInstancesEntry.getNewValue()); Assert.assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId());
Assert.assertEquals("2", numInstancesEntry.getNewValue()); Assert.assertEquals(asyncEntry.getOperationId(), numInstancesEntry.getOperationId());
jobDefOpLogEntry.getOperationId(), jobOpLogEntry.getOperationId());