Skip to content

Commit

Permalink
Minor polish
Browse files Browse the repository at this point in the history
  • Loading branch information
mminella committed Mar 28, 2018
1 parent c1b79e5 commit 502cd9b
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -23,10 +28,6 @@
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;

/**
Expand Down Expand Up @@ -147,8 +148,9 @@ public void testFilterCountOnRetryWithNonTransactionalProcessorWhenSkipInWrite()
public void testExceptionInProcessDuringChunkScan() throws Exception {
// Given
ListItemReader<Integer> itemReader = new ListItemReader<>(Arrays.asList(1, 2, 3, 4, 5, 6, 7));

ItemProcessor<Integer, Integer> itemProcessor = new ItemProcessor<Integer, Integer>() {
int cpt;
private int cpt;

@Override
public Integer process(Integer item) throws Exception {
Expand All @@ -159,8 +161,9 @@ public Integer process(Integer item) throws Exception {
return item;
}
};

ItemWriter<Integer> itemWriter = new ItemWriter<Integer>() {
int cpt;
private int cpt;

@Override
public void write(List<? extends Integer> items) throws Exception {
Expand All @@ -170,6 +173,7 @@ public void write(List<? extends Integer> items) throws Exception {
}
}
};

Step step = new StepBuilderFactory(jobRepository, transactionManager).get("step")
.<Integer, Integer>chunk(5)
.reader(itemReader)
Expand Down

0 comments on commit 502cd9b

Please sign in to comment.