Search in sources :

Example 1 with UserOperationLogEntryEventEntity

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()));
}
Also used : UserOperationLogEntry(org.camunda.bpm.engine.history.UserOperationLogEntry) UserOperationLogEntryEventEntity(org.camunda.bpm.engine.impl.history.event.UserOperationLogEntryEventEntity) ReadOnlyProcessDefinition(org.camunda.bpm.engine.impl.pvm.ReadOnlyProcessDefinition) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) Deployment(org.camunda.bpm.engine.test.Deployment) RequiredHistoryLevel(org.camunda.bpm.engine.test.RequiredHistoryLevel)

Aggregations

UserOperationLogEntry (org.camunda.bpm.engine.history.UserOperationLogEntry)1 UserOperationLogEntryEventEntity (org.camunda.bpm.engine.impl.history.event.UserOperationLogEntryEventEntity)1 ReadOnlyProcessDefinition (org.camunda.bpm.engine.impl.pvm.ReadOnlyProcessDefinition)1 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1 Deployment (org.camunda.bpm.engine.test.Deployment)1 RequiredHistoryLevel (org.camunda.bpm.engine.test.RequiredHistoryLevel)1