public void testQueryByInvalidExecutionId() { HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().executionIdIn("invalid"); verifyQueryResults(query, 0); String[] nullValue = null; try { query.executionIdIn(nullValue); fail(); } catch (Exception e) { } String[] executionIdsContainsNull = {"a", null, "b"}; try { query.executionIdIn(executionIdsContainsNull); fail(); } catch (Exception e) { } String[] executionIdsContainsEmptyString = {"a", "", "b"}; try { query.executionIdIn(executionIdsContainsEmptyString); fail(); } catch (Exception e) { } }
@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.executionIdIn(executionIds);
query.executionIdIn(executionIds);
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryByExecutionId() { runtimeService.startProcessInstanceByKey("process"); String executionId = managementService.createJobQuery().singleResult().getExecutionId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().executionIdIn(executionId); verifyQueryResults(query, 1); }
public void testQueryByInvalidExecutionId() { HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().executionIdIn("invalid"); verifyQueryResults(query, 0); String[] nullValue = null; try { query.executionIdIn(nullValue); fail(); } catch (Exception e) { } String[] executionIdsContainsNull = {"a", null, "b"}; try { query.executionIdIn(executionIdsContainsNull); fail(); } catch (Exception e) { } String[] executionIdsContainsEmptyString = {"a", "", "b"}; try { query.executionIdIn(executionIdsContainsEmptyString); fail(); } catch (Exception e) { } }
query.executionIdIn(executionIds);
@Deployment(resources = {"org/camunda/bpm/engine/test/history/HistoricJobLogTest.testAsyncContinuation.bpmn20.xml"}) public void testQueryByExecutionId() { runtimeService.startProcessInstanceByKey("process"); String executionId = managementService.createJobQuery().singleResult().getExecutionId(); HistoricJobLogQuery query = historyService.createHistoricJobLogQuery().executionIdIn(executionId); verifyQueryResults(query, 1); }