I am writing integration tests for a Spring Batch
Project, which has the following configuration
@Configuration
@EnableScheduling
@PropertySource("application.properties")
public class BatchConfig(
private JobBuilderFactory factory;
public BatchConfig(JobBuilderFactory factory) {
this.factory = factory;
}
@Bean
public Step someStep {
// step implementation
}
}
I created the following base test class
@ContextConfiguration(classes=BatchConfig.class)
@SpringBootTest
public class BatchTestBase {
@Autowired
Step someStep
}
When I extend this class and try running it, I get the following error
Parameter 0 of constructor in BatchConfig required a bean of type JobBuilderFactory that could not be found
Is there any way to extend BatchConfig
to XML
or add constructor parameters here to access the beans?