use of org.camunda.bpm.engine.impl.history.event.UserOperationLogEntryEventEntity in project camunda-bpm-platform by camunda.
the class RepositoryServiceTest method testProcessDefinitionUpdateTimeToLiveUserOperationLog.
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_FULL)
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testProcessDefinitionUpdateTimeToLiveUserOperationLog() {
// given
ProcessDefinition processDefinition = findOnlyProcessDefinition();
Integer timeToLiveOrgValue = processDefinition.getHistoryTimeToLive();
processEngine.getIdentityService().setAuthenticatedUserId("userId");
// when
Integer timeToLiveNewValue = 6;
repositoryService.updateProcessDefinitionHistoryTimeToLive(processDefinition.getId(), timeToLiveNewValue);
// then
List<UserOperationLogEntry> opLogEntries = processEngine.getHistoryService().createUserOperationLogQuery().list();
Assert.assertEquals(1, opLogEntries.size());
final UserOperationLogEntryEventEntity userOperationLogEntry = (UserOperationLogEntryEventEntity) opLogEntries.get(0);
assertEquals(UserOperationLogEntry.OPERATION_TYPE_UPDATE_HISTORY_TIME_TO_LIVE, userOperationLogEntry.getOperationType());
assertEquals(processDefinition.getKey(), userOperationLogEntry.getProcessDefinitionKey());
assertEquals(processDefinition.getId(), userOperationLogEntry.getProcessDefinitionId());
assertEquals("historyTimeToLive", userOperationLogEntry.getProperty());
assertEquals(timeToLiveOrgValue, Integer.valueOf(userOperationLogEntry.getOrgValue()));
assertEquals(timeToLiveNewValue, Integer.valueOf(userOperationLogEntry.getNewValue()));
}
Aggregations