diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java index 47c709b3e7..ff9d65b5e2 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/CommonsDataSourceConfiguration.java @@ -51,11 +51,11 @@ public class CommonsDataSourceConfiguration extends AbstractDataSourceConfigurat public DataSource dataSource() { logger.info("Hint: using Commons DBCP BasicDataSource. It's going to work, " + "but the Tomcat DataSource is more reliable."); - this.pool = createAndSetupPool(); + this.pool = createAndConfigurePool(); return this.pool; } - private BasicDataSource createAndSetupPool() { + private BasicDataSource createAndConfigurePool() { BasicDataSource pool = new BasicDataSource(); pool.setDriverClassName(getDriverClassName()); pool.setUrl(getUrl()); diff --git a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java index 28ec1a1fbe..99bfbc3c39 100644 --- a/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java +++ b/spring-boot/src/main/java/org/springframework/boot/test/SpringApplicationContextLoader.java @@ -77,7 +77,7 @@ public class SpringApplicationContextLoader extends AbstractContextLoader { List> initializers = getInitializers( mergedConfig, application); if (mergedConfig instanceof WebMergedContextConfiguration) { - new WebConfigurer().setup(mergedConfig, application, initializers); + new WebConfigurer().configure(mergedConfig, application, initializers); } else { application.setWebEnvironment(false); @@ -168,20 +168,22 @@ public class SpringApplicationContextLoader extends AbstractContextLoader { } private static class WebConfigurer { - void setup(MergedContextConfiguration mergedConfig, + + void configure(MergedContextConfiguration configuration, SpringApplication application, List> initializers) { - WebMergedContextConfiguration webConfig = (WebMergedContextConfiguration) mergedConfig; - if (AnnotationUtils.findAnnotation(webConfig.getTestClass(), + WebMergedContextConfiguration webConfiguration = (WebMergedContextConfiguration) configuration; + if (AnnotationUtils.findAnnotation(webConfiguration.getTestClass(), IntegrationTest.class) == null) { MockServletContext servletContext = new MockServletContext( - webConfig.getResourceBasePath()); + webConfiguration.getResourceBasePath()); initializers.add(0, new ServletContextApplicationContextInitializer( servletContext)); application .setApplicationContextClass(GenericWebApplicationContext.class); } } + } }