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:
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user