May 2015
Intermediate to advanced
234 pages
4h 18m
English
Spring Batch provides different ways to test a batch job; the whole job, only one step, or just a Tasklet class can be tested.
Follow these steps to unit test batch jobs:
spring-batch-test in pom.xml:<dependency> <groupId>org.springframework.batch</groupId> <artifactId>spring-batch-test</artifactId> <version>3.0.2.RELEASE</version> </dependency>
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {BatchConfig.class})
public class BatchJob1Test {
...@ContextConfiguration(classes = {BatchConfig.class}) public ...Read now
Unlock full access