From 502cd9b4e516ddce03bad59e636bd4d3f1fdc2b2 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 2dae35046..bf74493b2 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; /** @@ -147,8 +148,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 { @@ -159,8 +161,9 @@ public class FaultTolerantStepIntegrationTests { return item; } }; + ItemWriter itemWriter = new ItemWriter() { - int cpt; + private int cpt; @Override public void write(List items) throws Exception { @@ -170,6 +173,7 @@ public class FaultTolerantStepIntegrationTests { } } }; + Step step = new StepBuilderFactory(jobRepository, transactionManager).get("step") .chunk(5) .reader(itemReader)