Skip to content

Commit 6591657

Browse files
committed
Remove usage of deprecated API in ChunkOrientedStepIntegrationTests
1 parent 736aa94 commit 6591657

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

spring-batch-core/src/test/java/org/springframework/batch/core/step/item/ChunkOrientedStepIntegrationTests.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.springframework.batch.core.launch.JobOperator;
3939
import org.springframework.batch.core.repository.JobRepository;
4040
import org.springframework.batch.core.step.builder.ChunkOrientedStepBuilder;
41-
import org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy;
41+
import org.springframework.batch.core.step.skip.LimitCheckingExceptionHierarchySkipPolicy;
4242
import org.springframework.batch.core.step.skip.SkipLimitExceededException;
4343
import org.springframework.batch.item.ItemProcessor;
4444
import org.springframework.batch.item.ItemReader;
@@ -426,9 +426,10 @@ public Step faulTolerantChunkOrientedStep(JobRepository jobRepository,
426426

427427
// skip policy configuration
428428
int skipLimit = Integer.parseInt(System.getProperty("skipLimit"));
429-
Map<Class<? extends Throwable>, Boolean> skippableExceptions = Map.of(FlatFileParseException.class, true,
430-
DataIntegrityViolationException.class, true);
431-
LimitCheckingItemSkipPolicy skipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, skippableExceptions);
429+
Set<Class<? extends Throwable>> skippableExceptions = Set.of(FlatFileParseException.class,
430+
DataIntegrityViolationException.class);
431+
LimitCheckingExceptionHierarchySkipPolicy skipPolicy = new LimitCheckingExceptionHierarchySkipPolicy(
432+
skippableExceptions, skipLimit);
432433

433434
return new ChunkOrientedStepBuilder<Person, Person>(jobRepository, 2).reader(itemReader)
434435
.processor(itemProcessor)
@@ -460,9 +461,10 @@ public Step concurrentFaulTolerantChunkOrientedStep(JobRepository jobRepository,
460461

461462
// skip policy configuration
462463
int skipLimit = Integer.parseInt(System.getProperty("skipLimit"));
463-
Map<Class<? extends Throwable>, Boolean> skippableExceptions = Map.of(FlatFileParseException.class, true,
464-
DataIntegrityViolationException.class, true);
465-
LimitCheckingItemSkipPolicy skipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, skippableExceptions);
464+
Set<Class<? extends Throwable>> skippableExceptions = Set.of(FlatFileParseException.class,
465+
DataIntegrityViolationException.class);
466+
LimitCheckingExceptionHierarchySkipPolicy skipPolicy = new LimitCheckingExceptionHierarchySkipPolicy(
467+
skippableExceptions, skipLimit);
466468

467469
return new ChunkOrientedStepBuilder<Person, Person>(jobRepository, 2).reader(itemReader)
468470
.processor(itemProcessor)

0 commit comments

Comments
 (0)