Improve the type-safety of ContextLoader for servlet and reactive web
This commit is contained in:
committed by
Stephane Nicoll
parent
19ddfad63e
commit
dd0ce54425
@@ -21,6 +21,7 @@ import javax.sql.DataSource;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.boot.test.context.ContextLoader;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@@ -37,8 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
public class TestDatabaseAutoConfigurationTests {
|
||||
|
||||
private final ContextLoader contextLoader = new ContextLoader()
|
||||
.autoConfig(TestDatabaseAutoConfiguration.class);
|
||||
private final ContextLoader<AnnotationConfigApplicationContext> contextLoader = ContextLoader
|
||||
.standard().autoConfig(TestDatabaseAutoConfiguration.class);
|
||||
|
||||
@Test
|
||||
public void replaceWithNoDataSourceAvailable() {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.boot.test.autoconfigure.jdbc.TestDatabaseAutoConfigur
|
||||
import org.springframework.boot.test.context.ContextLoader;
|
||||
import org.springframework.boot.testsupport.runner.classpath.ClassPathExclusions;
|
||||
import org.springframework.boot.testsupport.runner.classpath.ModifiedClassPathRunner;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -43,8 +44,8 @@ import static org.mockito.Mockito.mock;
|
||||
@ClassPathExclusions({ "h2-*.jar", "hsqldb-*.jar", "derby-*.jar" })
|
||||
public class TestDatabaseAutoConfigurationNoEmbeddedTests {
|
||||
|
||||
private final ContextLoader contextLoader = new ContextLoader()
|
||||
.config(ExistingDataSourceConfiguration.class)
|
||||
private final ContextLoader<AnnotationConfigApplicationContext> contextLoader = ContextLoader
|
||||
.standard().config(ExistingDataSourceConfiguration.class)
|
||||
.autoConfig(TestDatabaseAutoConfiguration.class);
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user