use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class HistoricBatchRestServiceInteractionTest method setUpHistoricBatchQueryMock.
@Before
public void setUpHistoricBatchQueryMock() {
HistoricBatch historicBatchMock = MockProvider.createMockHistoricBatch();
queryMock = mock(HistoricBatchQuery.class);
when(queryMock.batchId(eq(MockProvider.EXAMPLE_BATCH_ID))).thenReturn(queryMock);
when(queryMock.singleResult()).thenReturn(historicBatchMock);
historyServiceMock = mock(HistoryService.class);
when(historyServiceMock.createHistoricBatchQuery()).thenReturn(queryMock);
when(processEngine.getHistoryService()).thenReturn(historyServiceMock);
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class MockHistoricBatchBuilder method build.
public HistoricBatch build() {
HistoricBatch historicBatch = mock(HistoricBatch.class);
when(historicBatch.getId()).thenReturn(id);
when(historicBatch.getType()).thenReturn(type);
when(historicBatch.getTotalJobs()).thenReturn(totalJobs);
when(historicBatch.getBatchJobsPerSeed()).thenReturn(batchJobsPerSeed);
when(historicBatch.getInvocationsPerBatchJob()).thenReturn(invocationsPerBatchJob);
when(historicBatch.getSeedJobDefinitionId()).thenReturn(seedJobDefinitionId);
when(historicBatch.getMonitorJobDefinitionId()).thenReturn(monitorJobDefinitionId);
when(historicBatch.getBatchJobDefinitionId()).thenReturn(batchJobDefinitionId);
when(historicBatch.getTenantId()).thenReturn(tenantId);
when(historicBatch.getStartTime()).thenReturn(startTime);
when(historicBatch.getEndTime()).thenReturn(endTime);
return historicBatch;
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class SetExternalTasksRetriesTest method cleanBatch.
@After
public void cleanBatch() {
List<Batch> batches = managementService.createBatchQuery().list();
if (batches.size() > 0) {
for (Batch batch : batches) {
managementService.deleteBatch(batch.getId(), true);
}
}
HistoricBatch historicBatch = historyService.createHistoricBatchQuery().singleResult();
if (historicBatch != null) {
historyService.deleteHistoricBatch(historicBatch.getId());
}
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricBatchQueryTest method testHistoricBatchQueryFilterByTenant.
@Test
public void testHistoricBatchQueryFilterByTenant() {
// when
HistoricBatch returnedBatch = historyService.createHistoricBatchQuery().tenantIdIn(TENANT_ONE).singleResult();
// then
Assert.assertNotNull(returnedBatch);
Assert.assertEquals(tenant1Batch.getId(), returnedBatch.getId());
}
use of org.camunda.bpm.engine.batch.history.HistoricBatch in project camunda-bpm-platform by camunda.
the class MultiTenancyHistoricBatchQueryTest method assertBatches.
protected void assertBatches(List<HistoricBatch> actualBatches, String... expectedIds) {
Assert.assertEquals(expectedIds.length, actualBatches.size());
Set<String> actualIds = new HashSet<String>();
for (HistoricBatch batch : actualBatches) {
actualIds.add(batch.getId());
}
for (String expectedId : expectedIds) {
Assert.assertTrue(actualIds.contains(expectedId));
}
}
Aggregations