@Test public void testQueryByTaskNameAsPost() { String taskName = "aTaskName"; Map<String, Object> params = new HashMap<String, Object>(); params.put("taskName", taskName); given() .contentType(POST_JSON_CONTENT_TYPE) .body(params) .then().expect().statusCode(Status.OK.getStatusCode()) .when().post(HISTORIC_TASK_INSTANCE_RESOURCE_URL); verify(mockedQuery).taskName(taskName); }
query.taskName(taskName);
query.taskName(taskName);
@Test public void shouldResolveHistoricTaskInstance() { // given testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); // when ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() .taskName("userTask") .singleResult(); // assume assertThat(historicTaskInstance, notNullValue()); // then assertThat(historicTaskInstance.getRootProcessInstanceId(), is(processInstance.getProcessInstanceId())); }
assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskName("Clean_up").count()); assertEquals(0, historyService.createHistoricTaskInstanceQuery().taskName("unexistingname").count()); assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskNameLike("Clean\\_u%").count()); assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskNameLike("%lean\\_up").count());
@Test public void testQueryByTaskName() { String taskName = "aTaskName"; given() .queryParam("taskName", taskName) .then().expect().statusCode(Status.OK.getStatusCode()) .when().get(HISTORIC_TASK_INSTANCE_RESOURCE_URL); verify(mockedQuery).taskName(taskName); }
query.taskName(taskName);
@Test public void shouldResolveHistoricTaskInstance() { // given ClockUtil.setCurrentTime(START_DATE); testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); // when ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() .taskName("userTask") .singleResult(); // assume assertThat(historicTaskInstance, notNullValue()); Date removalTime = addDays(START_DATE, 5); // then assertThat(historicTaskInstance.getRemovalTime(), is(removalTime)); }
assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskName("Clean_up").count()); assertEquals(0, historyService.createHistoricTaskInstanceQuery().taskName("unexistingname").count()); assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskNameLike("Clean\\_u%").count()); assertEquals(1, historyService.createHistoricTaskInstanceQuery().taskNameLike("%lean\\_up").count());
@Test public void shouldResolveHistoricTaskInstance() { // given testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); // when ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() .taskName("userTask") .singleResult(); // assume assertThat(historicTaskInstance, notNullValue()); // then assertThat(historicTaskInstance.getRootProcessInstanceId(), is(processInstance.getProcessInstanceId())); }
@Test public void shouldResolveHistoricTaskInstance() { // given ClockUtil.setCurrentTime(START_DATE); testRule.deploy(CALLING_PROCESS); testRule.deploy(CALLED_PROCESS); // when ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(CALLING_PROCESS_KEY); HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery() .taskName("userTask") .singleResult(); // assume assertThat(historicTaskInstance, notNullValue()); Date removalTime = addDays(START_DATE, 5); // then assertThat(historicTaskInstance.getRemovalTime(), is(removalTime)); }