See gh-20226
This commit is contained in:
Johnny Lim
2020-02-19 11:16:46 +09:00
committed by Stephane Nicoll
parent 0c76c0acb9
commit 8be8a8421d
17 changed files with 39 additions and 55 deletions

View File

@@ -104,7 +104,7 @@ public @interface DataJpaTest {
/**
* The {@link BootstrapMode} for the test repository support. Defaults to
* {@link BootstrapMode#LAZY}.
* @return the {@link BootstrapMode} to use for test the repository
* @return the {@link BootstrapMode} to use for testing the repository
*/
@PropertyMapping("spring.data.jpa.repositories.bootstrap-mode")
BootstrapMode bootstrapMode() default BootstrapMode.LAZY;

View File

@@ -28,7 +28,6 @@ import org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguratio
import org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import static org.assertj.core.api.Assertions.assertThat;
@@ -75,8 +74,8 @@ class WebMvcTestAutoConfigurationIntegrationTests {
@Test
void asyncTaskExecutorWithApplicationTaskExecutor() {
assertThat(this.applicationContext.getBeansOfType(AsyncTaskExecutor.class)).hasSize(1);
assertThat(ReflectionTestUtils.getField(this.applicationContext.getBean(RequestMappingHandlerAdapter.class),
"taskExecutor")).isSameAs(this.applicationContext.getBean("applicationTaskExecutor"));
assertThat(this.applicationContext.getBean(RequestMappingHandlerAdapter.class)).extracting("taskExecutor")
.isSameAs(this.applicationContext.getBean("applicationTaskExecutor"));
}
@Test