From 802cd856aabbe53278cd2ba04cb08e1b97138778 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 27 Feb 2018 14:31:36 -0800 Subject: [PATCH] Remove test-autoconfigure dependency Update `spring-boot-actuator-autoconfigure` so that it no longer has a dependency on `spring-boot-test-autoconfigure`. This will allow us to add test support for actuator concerns in the future if we need to. Fixed gh-12270 --- .../spring-boot-actuator-autoconfigure/pom.xml | 5 ----- .../FlywayEndpointDocumentationTests.java | 13 +++++++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml index cad5c3b02f..0ef5930a77 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml @@ -374,11 +374,6 @@ spring-boot-test test - - org.springframework.boot - spring-boot-test-autoconfigure - test - org.springframework.boot spring-boot-test-support diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java index 4bb89d320a..c146c28a7d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java @@ -19,6 +19,8 @@ package org.springframework.boot.actuate.autoconfigure.endpoint.web.documentatio import java.util.Arrays; import java.util.List; +import javax.sql.DataSource; + import org.flywaydb.core.api.MigrationState; import org.flywaydb.core.api.MigrationType; import org.junit.Test; @@ -26,11 +28,12 @@ import org.junit.Test; import org.springframework.boot.actuate.flyway.FlywayEndpoint; import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration; -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; +import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; +import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation; import org.springframework.restdocs.payload.FieldDescriptor; @@ -44,7 +47,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. * * @author Andy Wilkinson */ -@AutoConfigureTestDatabase public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentationTests { @Test @@ -100,6 +102,13 @@ public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentati FlywayAutoConfiguration.class }) static class TestConfiguration { + @Bean + public DataSource dataSource() { + return new EmbeddedDatabaseBuilder().generateUniqueName(true).setType( + EmbeddedDatabaseConnection.get(getClass().getClassLoader()).getType()) + .build(); + } + @Bean public FlywayEndpoint endpoint(ApplicationContext context) { return new FlywayEndpoint(context);