@Test
public void testWriteRetryOnTwoExceptions() throws Exception {
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy();
retryPolicy.setMaxAttempts(2);
batchRetryTemplate.setRetryPolicy(retryPolicy);
processor.setWriteSkipPolicy(new AlwaysSkipItemSkipPolicy());
processor.setItemWriter(new ItemWriter<String>() {
@Override
public void write(List<? extends String> items) throws Exception {
if (items.contains("fail")) {
throw new IllegalArgumentException("Expected Exception!");