Stop deferring JPA bootstrap mode by default

This commit changes the default value of bootstrap-mode to "default"
rather than "deferred" so that the JPA infrastructure starts in the
main thread rather than asynchronously.

Closes gh-24249
This commit is contained in:
Stephane Nicoll
2020-12-08 15:42:14 +01:00
parent f84cb1b765
commit 06671aa50e
7 changed files with 12 additions and 12 deletions

View File

@@ -103,11 +103,11 @@ public @interface DataJpaTest {
/**
* The {@link BootstrapMode} for the test repository support. Defaults to
* {@link BootstrapMode#LAZY}.
* {@link BootstrapMode#DEFAULT}.
* @return the {@link BootstrapMode} to use for testing the repository
*/
@PropertyMapping("spring.data.jpa.repositories.bootstrap-mode")
BootstrapMode bootstrapMode() default BootstrapMode.LAZY;
BootstrapMode bootstrapMode() default BootstrapMode.DEFAULT;
/**
* Determines if default filtering should be used with

View File

@@ -109,9 +109,9 @@ class DataJpaTestIntegrationTests {
}
@Test
void bootstrapModeIsLazyByDefault() {
void bootstrapModeIsDefaultByDefault() {
assertThat(this.applicationContext.getEnvironment().getProperty("spring.data.jpa.repositories.bootstrap-mode"))
.isEqualTo(BootstrapMode.LAZY.name());
.isEqualTo(BootstrapMode.DEFAULT.name());
}
}