writer.setFailures("4");
factory.setSkipLimit(3);
factory.setSkippableExceptionClasses(getExceptionMap(Exception.class));
Step step = factory.getObject();
step.execute(stepExecution);
assertEquals(BatchStatus.FAILED, stepExecution.getStatus());
assertEquals(3, stepExecution.getSkipCount());
assertEquals(2, stepExecution.getReadSkipCount());
assertEquals(1, stepExecution.getWriteSkipCount());
assertEquals(2, stepExecution.getReadCount());
// writer did not skip "2" as it never made it to writer, only "4" did
assertFalse(reader.getRead().contains("2"));
assertTrue(reader.getRead().contains("4"));
// only "1" was ever committed
List<String> expectedOutput = Arrays.asList(StringUtils.commaDelimitedListToStringArray("1"));
assertEquals(expectedOutput, writer.getCommitted());
assertStepExecutionsAreEqual(stepExecution, repository.getLastStepExecution(jobExecution.getJobInstance(), step
.getName()));
}