use of org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchDto in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceQueryTest method verifyHistoricBatchListJson.
protected void verifyHistoricBatchListJson(String historicBatchListJson) {
List<Object> batches = from(historicBatchListJson).get();
assertEquals("There should be one historic batch returned.", 1, batches.size());
HistoricBatchDto historicBatch = from(historicBatchListJson).getObject("[0]", HistoricBatchDto.class);
assertNotNull("The returned historic batch should not be null.", historicBatch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, historicBatch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, historicBatch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, historicBatch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, historicBatch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, historicBatch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, historicBatch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, historicBatch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, historicBatch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, historicBatch.getTenantId());
assertEquals(DateTimeUtil.parseDate(MockProvider.EXAMPLE_HISTORIC_BATCH_START_TIME), historicBatch.getStartTime());
assertEquals(DateTimeUtil.parseDate(MockProvider.EXAMPLE_HISTORIC_BATCH_END_TIME), historicBatch.getEndTime());
}
use of org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchDto in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceInteractionTest method verifyHistoricBatchJson.
protected void verifyHistoricBatchJson(String historicBatchJson) {
HistoricBatchDto historicBatch = from(historicBatchJson).getObject("", HistoricBatchDto.class);
assertNotNull("The returned historic batch should not be null.", historicBatch);
assertEquals(MockProvider.EXAMPLE_BATCH_ID, historicBatch.getId());
assertEquals(MockProvider.EXAMPLE_BATCH_TYPE, historicBatch.getType());
assertEquals(MockProvider.EXAMPLE_BATCH_TOTAL_JOBS, historicBatch.getTotalJobs());
assertEquals(MockProvider.EXAMPLE_BATCH_JOBS_PER_SEED, historicBatch.getBatchJobsPerSeed());
assertEquals(MockProvider.EXAMPLE_INVOCATIONS_PER_BATCH_JOB, historicBatch.getInvocationsPerBatchJob());
assertEquals(MockProvider.EXAMPLE_SEED_JOB_DEFINITION_ID, historicBatch.getSeedJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_MONITOR_JOB_DEFINITION_ID, historicBatch.getMonitorJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_BATCH_JOB_DEFINITION_ID, historicBatch.getBatchJobDefinitionId());
assertEquals(MockProvider.EXAMPLE_TENANT_ID, historicBatch.getTenantId());
assertEquals(DateTimeUtil.parseDate(MockProvider.EXAMPLE_HISTORIC_BATCH_START_TIME), historicBatch.getStartTime());
assertEquals(DateTimeUtil.parseDate(MockProvider.EXAMPLE_HISTORIC_BATCH_END_TIME), historicBatch.getEndTime());
}
use of org.camunda.bpm.engine.rest.dto.history.batch.HistoricBatchDto in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceImpl method getHistoricBatches.
@SuppressWarnings("unchecked")
@Override
public List<HistoricBatchDto> getHistoricBatches(UriInfo uriInfo, Integer firstResult, Integer maxResults) {
HistoricBatchQueryDto queryDto = new HistoricBatchQueryDto(objectMapper, uriInfo.getQueryParameters());
HistoricBatchQuery query = queryDto.toQuery(processEngine);
List<HistoricBatch> matchingBatches;
if (firstResult != null || maxResults != null) {
matchingBatches = (List<HistoricBatch>) executePaginatedQuery(query, firstResult, maxResults);
} else {
matchingBatches = query.list();
}
List<HistoricBatchDto> batchResults = new ArrayList<HistoricBatchDto>();
for (HistoricBatch matchingBatch : matchingBatches) {
batchResults.add(HistoricBatchDto.fromBatch(matchingBatch));
}
return batchResults;
}
Aggregations