use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailAuthorizationTest method testFormFieldQueryWithoutAuthorization.
// historic variable update query (multiple process instances) ///////////////////////////////////////////
public void testFormFieldQueryWithoutAuthorization() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
startProcessInstanceByKey(MESSAGE_START_PROCESS_KEY, getVariables());
// when
HistoricDetailQuery query = historyService.createHistoricDetailQuery().formFields();
// then
verifyQueryResults(query, 0);
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailQueryTest method testQueryByUserOperationId.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByUserOperationId() {
startProcessInstance(PROCESS_KEY);
identityService.setAuthenticatedUserId("demo");
String taskId = taskService.createTaskQuery().singleResult().getId();
// when
taskService.resolveTask(taskId, getVariables());
// then
String userOperationId = historyService.createHistoricDetailQuery().singleResult().getUserOperationId();
HistoricDetailQuery query = historyService.createHistoricDetailQuery().userOperationId(userOperationId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailQueryTest method testQueryByExecutionId.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/api/oneTaskProcess.bpmn20.xml" })
public void testQueryByExecutionId() {
startProcessInstance(PROCESS_KEY);
String taskId = taskService.createTaskQuery().singleResult().getId();
// when
taskService.resolveTask(taskId, getVariables());
// then
String executionId = historyService.createHistoricDetailQuery().singleResult().getExecutionId();
HistoricDetailQuery query = historyService.createHistoricDetailQuery().executionId(executionId);
assertEquals(1, query.list().size());
assertEquals(1, query.count());
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class FullHistoryTest method testHistoricDetailQueryByVariableInstanceId.
@Test
@Deployment(resources = { "org/camunda/bpm/engine/test/history/oneTaskProcess.bpmn20.xml" })
public void testHistoricDetailQueryByVariableInstanceId() throws Exception {
Map<String, Object> params = new HashMap<String, Object>();
params.put("testVar", "testValue");
runtimeService.startProcessInstanceByKey("oneTaskProcess", params);
HistoricVariableInstance testVariable = historyService.createHistoricVariableInstanceQuery().variableName("testVar").singleResult();
HistoricDetailQuery query = historyService.createHistoricDetailQuery();
query.variableInstanceId(testVariable.getId());
assertEquals(1, query.count());
assertEquals(1, query.list().size());
}
use of org.camunda.bpm.engine.history.HistoricDetailQuery in project camunda-bpm-platform by camunda.
the class HistoricDetailRestServiceQueryTest method setUpMockedDetailsQuery.
protected HistoricDetailQuery setUpMockedDetailsQuery(List<HistoricDetail> detailMocks) {
HistoricDetailQuery mock = mock(HistoricDetailQuery.class);
when(mock.list()).thenReturn(detailMocks);
when(mock.count()).thenReturn((long) detailMocks.size());
when(processEngine.getHistoryService().createHistoricDetailQuery()).thenReturn(mock);
return mock;
}
Aggregations