Merge branch '2.1.x'
Closes gh-17453
This commit is contained in:
@@ -40,6 +40,7 @@ import org.springframework.transaction.PlatformTransactionManager;
|
||||
class BatchConfigurerConfiguration {
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnBean(DataSource.class)
|
||||
@ConditionalOnMissingBean(name = "entityManagerFactory")
|
||||
static class JdbcBatchConfiguration {
|
||||
|
||||
|
||||
@@ -91,7 +91,13 @@ class BatchAutoConfigurationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
void testNoDatabase() {
|
||||
void whenThereIsNoDataSourceAutoConfigurationBacksOff() {
|
||||
this.contextRunner.withUserConfiguration(TestConfiguration.class)
|
||||
.run((context) -> assertThat(context).doesNotHaveBean(BatchConfigurer.class));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testCustomConfigurationWithNoDatabase() {
|
||||
this.contextRunner.withUserConfiguration(TestCustomConfiguration.class).run((context) -> {
|
||||
assertThat(context).hasSingleBean(JobLauncher.class);
|
||||
JobExplorer explorer = context.getBean(JobExplorer.class);
|
||||
|
||||
Reference in New Issue
Block a user