use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogAuthorizationTest method testQueryWithHistoryReadPermissionOnAnyProcessDefinition.
public void testQueryWithHistoryReadPermissionOnAnyProcessDefinition() {
// given
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
disableAuthorization();
String jobId = managementService.createJobQuery().processDefinitionKey(TIMER_START_PROCESS_KEY).singleResult().getId();
managementService.executeJob(jobId);
jobId = managementService.createJobQuery().processDefinitionKey(TIMER_START_PROCESS_KEY).singleResult().getId();
managementService.executeJob(jobId);
enableAuthorization();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_HISTORY);
// when
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();
// then
verifyQueryResults(query, 17);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogAuthorizationTest method testStartTimerJobLogQueryWithoutAuthorization.
// historic job log query (start timer job) ////////////////////////////////
public void testStartTimerJobLogQueryWithoutAuthorization() {
// given
// when
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogAuthorizationTest method testQueryWithoutAuthorization.
// historic job log query (multiple process instance) ////////////////////////////////////////////////
public void testQueryWithoutAuthorization() {
// given
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
disableAuthorization();
String jobId = managementService.createJobQuery().processDefinitionKey(TIMER_START_PROCESS_KEY).singleResult().getId();
managementService.executeJob(jobId);
jobId = managementService.createJobQuery().processDefinitionKey(TIMER_START_PROCESS_KEY).singleResult().getId();
managementService.executeJob(jobId);
enableAuthorization();
// when
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogAuthorizationTest method testSimpleQueryWithHistoryReadPermissionOnProcessDefinition.
public void testSimpleQueryWithHistoryReadPermissionOnProcessDefinition() {
// given
startProcessAndExecuteJob(ONE_INCIDENT_PROCESS_KEY);
createGrantAuthorization(PROCESS_DEFINITION, ONE_INCIDENT_PROCESS_KEY, userId, READ_HISTORY);
// when
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();
// then
verifyQueryResults(query, 4);
}
use of org.camunda.bpm.engine.history.HistoricJobLogQuery in project camunda-bpm-platform by camunda.
the class HistoricJobLogTest method testDeletedJob.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml" })
public void testDeletedJob() {
// given
runtimeService.startProcessInstanceByKey("process");
String jobId = managementService.createJobQuery().singleResult().getId();
HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().jobId(jobId);
HistoricJobLogQuery createdQuery = historyService.createHistoricJobLogQuery().jobId(jobId).creationLog();
HistoricJobLogQuery deletedQuery = historyService.createHistoricJobLogQuery().jobId(jobId).deletionLog();
// there exists one historic job log entry
assertEquals(1, query.count());
assertEquals(1, createdQuery.count());
assertEquals(0, deletedQuery.count());
// when
managementService.deleteJob(jobId);
// then
assertEquals(2, query.count());
assertEquals(1, createdQuery.count());
assertEquals(1, deletedQuery.count());
HistoricJobLog createdJobLogEntry = createdQuery.singleResult();
assertEquals(3, createdJobLogEntry.getJobRetries());
HistoricJobLog deletedJobLogEntry = deletedQuery.singleResult();
assertEquals(3, deletedJobLogEntry.getJobRetries());
}
Aggregations