use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testHistoricTaskInstanceQueryByInvalidActivityInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricTaskInstanceTest.testHistoricTaskInstance.bpmn20.xml" })
public void testHistoricTaskInstanceQueryByInvalidActivityInstanceId() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.activityInstanceIdIn("invalid");
assertEquals(0, query.count());
try {
query.activityInstanceIdIn(null);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
try {
query.activityInstanceIdIn((String) null);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
try {
String[] values = { "a", null, "b" };
query.activityInstanceIdIn(values);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByInvalidProcessInstanceBusinessKeyIn.
public void testQueryByInvalidProcessInstanceBusinessKeyIn() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.processInstanceBusinessKeyIn("invalid");
assertEquals(0, query.count());
try {
query.processInstanceBusinessKeyIn(null);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
try {
query.processInstanceBusinessKeyIn((String) null);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
try {
String[] values = { "a", null, "b" };
query.processInstanceBusinessKeyIn(values);
fail("A ProcessEngineExcpetion was expected.");
} catch (ProcessEngineException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testQueryByInvalidTaskDefinitionKeys.
public void testQueryByInvalidTaskDefinitionKeys() {
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery();
query.taskDefinitionKeyIn("invalid");
assertEquals(0, query.count());
try {
query.taskDefinitionKeyIn(null);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
try {
query.taskDefinitionKeyIn((String) null);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
try {
String[] values = { "a", null, "b" };
query.taskDefinitionKeyIn(values);
fail("A ProcessEngineExcpetion was expected.");
} catch (NotValidException e) {
}
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class HistoricTaskInstanceTest method testHistoricTaskInstanceQueryByActivityInstanceId.
@Deployment(resources = { "org/camunda/bpm/engine/test/history/HistoricTaskInstanceTest.testHistoricTaskInstance.bpmn20.xml" })
public void testHistoricTaskInstanceQueryByActivityInstanceId() throws Exception {
runtimeService.startProcessInstanceByKey("HistoricTaskInstanceTest");
String activityInstanceId = historyService.createHistoricActivityInstanceQuery().activityId("task").singleResult().getId();
HistoricTaskInstanceQuery query = historyService.createHistoricTaskInstanceQuery().activityInstanceIdIn(activityInstanceId);
assertEquals(1, query.count());
assertEquals(1, query.list().size());
}
use of org.camunda.bpm.engine.history.HistoricTaskInstanceQuery in project camunda-bpm-platform by camunda.
the class ProcessEngineRestServiceTest method createHistoricTaskInstanceMock.
private void createHistoricTaskInstanceMock() {
List<HistoricTaskInstance> tasks = MockProvider.createMockHistoricTaskInstances();
HistoricTaskInstanceQuery query = mock(HistoricTaskInstanceQuery.class);
when(mockHistoryService.createHistoricTaskInstanceQuery()).thenReturn(query);
when(query.list()).thenReturn(tasks);
}
Aggregations