public void testQueryByInvalidActivityId() { HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().activityIdIn("invalid"); verifyQueryResults(query, 0); String[] nullValue = null; try { query.activityIdIn(nullValue); fail(); } catch (Exception e) { } String[] activityIdsContainsNull = {"a", null, "b"}; try { query.activityIdIn(activityIdsContainsNull); fail(); } catch (Exception e) { } String[] activityIdsContainsEmptyString = {"a", "", "b"}; try { query.activityIdIn(activityIdsContainsEmptyString); fail(); } catch (Exception e) { } }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryByActivityId() { runtimeService.startProcessInstanceByKey("process"); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().activityIdIn("serviceTask"); verifyQueryResults(query, 1); }
@Test public void testListParametersAsPost() { String anActId = "anActId"; String anotherActId = "anotherActId"; String anExecutionId = "anExecutionId"; String anotherExecutionId = "anotherExecutionId"; Map<String, List<String>> json = new HashMap<String, List<String>>(); json.put("activityIdIn", Arrays.asList(anActId, anotherActId)); json.put("executionIdIn", Arrays.asList(anExecutionId, anotherExecutionId)); given() .contentType(POST_JSON_CONTENT_TYPE) .body(json) .then() .expect() .statusCode(Status.OK.getStatusCode()) .when() .post(HISTORIC_JOB_LOG_RESOURCE_URL); verify(mockedQuery).activityIdIn(anActId, anotherActId); verify(mockedQuery).executionIdIn(anExecutionId, anotherExecutionId); verify(mockedQuery).list(); }
@Test public void testListParameters() { String anActId = "anActId"; String anotherActId = "anotherActId"; String anExecutionId = "anExecutionId"; String anotherExecutionId = "anotherExecutionId"; given() .queryParam("activityIdIn", anActId + "," + anotherActId) .queryParam("executionIdIn", anExecutionId + "," + anotherExecutionId) .then() .expect() .statusCode(Status.OK.getStatusCode()) .when() .get(HISTORIC_JOB_LOG_RESOURCE_URL); verify(mockedQuery).activityIdIn(anActId, anotherActId); verify(mockedQuery).executionIdIn(anExecutionId, anotherExecutionId); verify(mockedQuery).list(); }
query.activityIdIn(activityIds);
query.activityIdIn(activityIds);
public void testQueryByInvalidActivityId() { HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().activityIdIn("invalid"); verifyQueryResults(query, 0); String[] nullValue = null; try { query.activityIdIn(nullValue); fail(); } catch (Exception e) { } String[] activityIdsContainsNull = {"a", null, "b"}; try { query.activityIdIn(activityIdsContainsNull); fail(); } catch (Exception e) { } String[] activityIdsContainsEmptyString = {"a", "", "b"}; try { query.activityIdIn(activityIdsContainsEmptyString); fail(); } catch (Exception e) { } }
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryByActivityId() { runtimeService.startProcessInstanceByKey("process"); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().activityIdIn("serviceTask"); verifyQueryResults(query, 1); }
query.activityIdIn(activityIds);