Skip to content

Commit 802cd85

Browse files
committed
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
1 parent 438004e commit 802cd85

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,6 @@
374374
<artifactId>spring-boot-test</artifactId>
375375
<scope>test</scope>
376376
</dependency>
377-
<dependency>
378-
<groupId>org.springframework.boot</groupId>
379-
<artifactId>spring-boot-test-autoconfigure</artifactId>
380-
<scope>test</scope>
381-
</dependency>
382377
<dependency>
383378
<groupId>org.springframework.boot</groupId>
384379
<artifactId>spring-boot-test-support</artifactId>

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/documentation/FlywayEndpointDocumentationTests.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,21 @@
1919
import java.util.Arrays;
2020
import java.util.List;
2121

22+
import javax.sql.DataSource;
23+
2224
import org.flywaydb.core.api.MigrationState;
2325
import org.flywaydb.core.api.MigrationType;
2426
import org.junit.Test;
2527

2628
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
2729
import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
2830
import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
29-
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
31+
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
3032
import org.springframework.context.ApplicationContext;
3133
import org.springframework.context.annotation.Bean;
3234
import org.springframework.context.annotation.Configuration;
3335
import org.springframework.context.annotation.Import;
36+
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
3437
import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
3538
import org.springframework.restdocs.payload.FieldDescriptor;
3639

@@ -44,7 +47,6 @@
4447
*
4548
* @author Andy Wilkinson
4649
*/
47-
@AutoConfigureTestDatabase
4850
public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
4951

5052
@Test
@@ -100,6 +102,13 @@ private List<FieldDescriptor> migrationFieldDescriptors() {
100102
FlywayAutoConfiguration.class })
101103
static class TestConfiguration {
102104

105+
@Bean
106+
public DataSource dataSource() {
107+
return new EmbeddedDatabaseBuilder().generateUniqueName(true).setType(
108+
EmbeddedDatabaseConnection.get(getClass().getClassLoader()).getType())
109+
.build();
110+
}
111+
103112
@Bean
104113
public FlywayEndpoint endpoint(ApplicationContext context) {
105114
return new FlywayEndpoint(context);

0 commit comments

Comments
 (0)