diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java index 0068e6397ec7..e09ab3e8de0e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfiguration.java @@ -20,7 +20,6 @@ import javax.sql.DataSource; -import org.springframework.batch.core.configuration.BatchConfigurationException; import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing; import org.springframework.batch.core.configuration.support.DefaultBatchConfiguration; import org.springframework.batch.core.explore.JobExplorer; @@ -130,13 +129,6 @@ protected DataSource getDataSource() { return this.dataSource; } - @Bean - @ConditionalOnMissingBean - @Override - public JobRepository jobRepository() throws BatchConfigurationException { - return super.jobRepository(); - } - @Override protected PlatformTransactionManager getTransactionManager() { return this.transactionManager; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 3595227c959d..8f10bea4e035 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -517,13 +517,6 @@ void defaultExecutionContextSerializerIsUsed() { }); } - @Test - void defaultJobRepositoryIsNotCreatedWhenUserDefinedJobRepositoryBean() { - this.contextRunner - .withUserConfiguration(TestConfigurationWithJobRepository.class, EmbeddedDataSourceConfiguration.class) - .run((context) -> assertThat(context).hasSingleBean(TestJobRepository.class)); - } - private JobLauncherApplicationRunner createInstance(String... registeredJobNames) { JobLauncherApplicationRunner runner = new JobLauncherApplicationRunner(mock(JobLauncher.class), mock(JobExplorer.class), mock(JobRepository.class)); @@ -603,16 +596,6 @@ static class TestConfiguration { } - @TestAutoConfigurationPackage(City.class) - static class TestConfigurationWithJobRepository { - - @Bean - TestJobRepository jobRepository() { - return mock(TestJobRepository.class); - } - - } - @Configuration(proxyBeanMethods = false) static class EntityManagerFactoryConfiguration { @@ -897,8 +880,4 @@ ExecutionContextSerializer executionContextSerializer() { } - interface TestJobRepository extends JobRepository { - - } - }