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
pull/12276/head
Phillip Webb 7 years ago
parent 438004efe5
commit 802cd856aa

@ -374,11 +374,6 @@
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-autoconfigure</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test-support</artifactId>

@ -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);

Loading…
Cancel
Save