Skip to content

Commit 14bcfa8

Browse files
committed
Use component scanning
1 parent 5adc812 commit 14bcfa8

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/test/java/examples/springbatch/BatchConfiguration.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import org.mybatis.spring.batch.MyBatisCursorItemReader;
3232
import org.springframework.batch.core.Job;
3333
import org.springframework.batch.core.Step;
34-
import org.springframework.batch.core.configuration.annotation.BatchConfigurer;
3534
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
3635
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
3736
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
@@ -42,6 +41,7 @@
4241
import org.springframework.batch.test.JobLauncherTestUtils;
4342
import org.springframework.beans.factory.annotation.Autowired;
4443
import org.springframework.context.annotation.Bean;
44+
import org.springframework.context.annotation.ComponentScan;
4545
import org.springframework.context.annotation.Configuration;
4646
import org.springframework.core.convert.converter.Converter;
4747
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
@@ -51,6 +51,7 @@
5151
@EnableBatchProcessing
5252
@Configuration
5353
@MapperScan("examples.springbatch")
54+
@ComponentScan("examples.springbatch")
5455
public class BatchConfiguration {
5556

5657
@Autowired
@@ -69,11 +70,6 @@ public DataSource dataSource() {
6970
return db;
7071
}
7172

72-
@Bean
73-
public BatchConfigurer batchConfigurer() {
74-
return new NoPersistenceBatchConfigurer();
75-
}
76-
7773
@Bean
7874
public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) {
7975
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
@@ -82,7 +78,7 @@ public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) {
8278
}
8379

8480
@Bean
85-
public JobLauncherTestUtils jobLauncherTestUtils(Job job) {
81+
public JobLauncherTestUtils jobLauncherTestUtils() {
8682
return new JobLauncherTestUtils();
8783
}
8884

0 commit comments

Comments
 (0)