From c1393a0f6a135bc900db700e0f29e1ef5119f261 Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Wed, 28 Mar 2018 09:53:55 -0500 Subject: [PATCH] Minor polish --- .../step/FaultTolerantStepIntegrationTests.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java index 384cc3bf0..7fa41e81f 100644 --- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java +++ b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepIntegrationTests.java @@ -1,8 +1,13 @@ package org.springframework.batch.core.test.step; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.batch.core.BatchStatus; import org.springframework.batch.core.ExitStatus; import org.springframework.batch.core.JobExecution; @@ -23,10 +28,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.transaction.PlatformTransactionManager; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import static org.junit.Assert.assertEquals; /** @@ -158,8 +159,9 @@ public class FaultTolerantStepIntegrationTests { public void testExceptionInProcessDuringChunkScan() throws Exception { // Given ListItemReader itemReader = new ListItemReader<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7)); + ItemProcessor itemProcessor = new ItemProcessor() { - int cpt; + private int cpt; @Override public Integer process(Integer item) throws Exception { @@ -170,8 +172,9 @@ public class FaultTolerantStepIntegrationTests { return item; } }; + ItemWriter itemWriter = new ItemWriter() { - int cpt; + private int cpt; @Override public void write(List items) throws Exception { @@ -181,6 +184,7 @@ public class FaultTolerantStepIntegrationTests { } } }; + Step step = new StepBuilderFactory(jobRepository, transactionManager).get("step") .chunk(5) .reader(itemReader)