@Test public void testAggregateEmpty() { aggregator.aggregate(result, Collections.<StepExecution> emptySet()); }
@Test public void testAggregateNull() { aggregator.aggregate(result, null); }
@Test public void testAggregateStatusSunnyDay() { stepExecution1.setStatus(BatchStatus.COMPLETED); stepExecution2.setStatus(BatchStatus.COMPLETED); aggregator.aggregate(result, Arrays.<StepExecution> asList(stepExecution1, stepExecution2)); assertNotNull(result); assertEquals(BatchStatus.STARTING, result.getStatus()); }
@Test(expected=IllegalStateException.class) public void testAggregateStatusMissingExecution() { stepExecution2 = jobExecution.createStepExecution("foo:3"); stepExecution1.setStatus(BatchStatus.COMPLETED); stepExecution2.setStatus(BatchStatus.COMPLETED); aggregator.aggregate(result, Arrays.<StepExecution> asList(stepExecution1, stepExecution2)); assertNotNull(result); assertEquals(BatchStatus.STARTING, result.getStatus()); }