|
19 | 19 | import java.util.Arrays;
|
20 | 20 | import java.util.List;
|
21 | 21 |
|
| 22 | +import javax.sql.DataSource; |
| 23 | + |
22 | 24 | import org.flywaydb.core.api.MigrationState;
|
23 | 25 | import org.flywaydb.core.api.MigrationType;
|
24 | 26 | import org.junit.Test;
|
25 | 27 |
|
26 | 28 | import org.springframework.boot.actuate.flyway.FlywayEndpoint;
|
27 | 29 | import org.springframework.boot.autoconfigure.flyway.FlywayAutoConfiguration;
|
28 | 30 | import org.springframework.boot.autoconfigure.jdbc.EmbeddedDataSourceConfiguration;
|
29 |
| -import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; |
| 31 | +import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; |
30 | 32 | import org.springframework.context.ApplicationContext;
|
31 | 33 | import org.springframework.context.annotation.Bean;
|
32 | 34 | import org.springframework.context.annotation.Configuration;
|
33 | 35 | import org.springframework.context.annotation.Import;
|
| 36 | +import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder; |
34 | 37 | import org.springframework.restdocs.mockmvc.MockMvcRestDocumentation;
|
35 | 38 | import org.springframework.restdocs.payload.FieldDescriptor;
|
36 | 39 |
|
|
44 | 47 | *
|
45 | 48 | * @author Andy Wilkinson
|
46 | 49 | */
|
47 |
| -@AutoConfigureTestDatabase |
48 | 50 | public class FlywayEndpointDocumentationTests extends MockMvcEndpointDocumentationTests {
|
49 | 51 |
|
50 | 52 | @Test
|
@@ -100,6 +102,13 @@ private List<FieldDescriptor> migrationFieldDescriptors() {
|
100 | 102 | FlywayAutoConfiguration.class })
|
101 | 103 | static class TestConfiguration {
|
102 | 104 |
|
| 105 | + @Bean |
| 106 | + public DataSource dataSource() { |
| 107 | + return new EmbeddedDatabaseBuilder().generateUniqueName(true).setType( |
| 108 | + EmbeddedDatabaseConnection.get(getClass().getClassLoader()).getType()) |
| 109 | + .build(); |
| 110 | + } |
| 111 | + |
103 | 112 | @Bean
|
104 | 113 | public FlywayEndpoint endpoint(ApplicationContext context) {
|
105 | 114 | return new FlywayEndpoint(context);
|
|
0 commit comments