Move code from spring-boot-actuator to spring-boot-flyway
See gh-46086
This commit is contained in:
parent
0497cd48ad
commit
d46d93c6a9
|
@ -19,12 +19,12 @@ package org.springframework.boot.actuate.autoconfigure.flyway;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
|
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnAvailableEndpoint;
|
||||||
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
|
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
|
||||||
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
@ -36,7 +36,7 @@ import org.springframework.context.annotation.Bean;
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
@AutoConfiguration(after = FlywayAutoConfiguration.class)
|
@AutoConfiguration(after = FlywayAutoConfiguration.class)
|
||||||
@ConditionalOnClass(Flyway.class)
|
@ConditionalOnClass({ Flyway.class, FlywayEndpoint.class })
|
||||||
@ConditionalOnAvailableEndpoint(FlywayEndpoint.class)
|
@ConditionalOnAvailableEndpoint(FlywayEndpoint.class)
|
||||||
public class FlywayEndpointAutoConfiguration {
|
public class FlywayEndpointAutoConfiguration {
|
||||||
|
|
||||||
|
|
|
@ -19,8 +19,8 @@ package org.springframework.boot.actuate.autoconfigure.flyway;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
|
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
|
||||||
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
|
|
@ -24,8 +24,8 @@ import org.flywaydb.core.api.MigrationState;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
|
import org.springframework.boot.actuate.docs.MockMvcEndpointDocumentationTests;
|
||||||
import org.springframework.boot.actuate.flyway.FlywayEndpoint;
|
|
||||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||||
|
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint;
|
||||||
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
||||||
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
|
import org.springframework.boot.jdbc.EmbeddedDatabaseConnection;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
|
@ -40,7 +40,6 @@ dependencies {
|
||||||
dockerTestImplementation("org.testcontainers:testcontainers")
|
dockerTestImplementation("org.testcontainers:testcontainers")
|
||||||
|
|
||||||
optional(project(":spring-boot-project:spring-boot-activemq"))
|
optional(project(":spring-boot-project:spring-boot-activemq"))
|
||||||
optional(project(":spring-boot-project:spring-boot-flyway"))
|
|
||||||
optional(project(":spring-boot-project:spring-boot-http-converter"))
|
optional(project(":spring-boot-project:spring-boot-http-converter"))
|
||||||
optional(project(":spring-boot-project:spring-boot-jdbc"))
|
optional(project(":spring-boot-project:spring-boot-jdbc"))
|
||||||
optional(project(":spring-boot-project:spring-boot-jetty"))
|
optional(project(":spring-boot-project:spring-boot-jetty"))
|
||||||
|
|
|
@ -30,6 +30,7 @@ dependencies {
|
||||||
api(project(":spring-boot-project:spring-boot-jdbc"))
|
api(project(":spring-boot-project:spring-boot-jdbc"))
|
||||||
api("org.flywaydb:flyway-core")
|
api("org.flywaydb:flyway-core")
|
||||||
|
|
||||||
|
optional(project(":spring-boot-project:spring-boot-actuator"))
|
||||||
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||||
optional("org.flywaydb:flyway-database-oracle")
|
optional("org.flywaydb:flyway-database-oracle")
|
||||||
optional("org.flywaydb:flyway-database-postgresql")
|
optional("org.flywaydb:flyway-database-postgresql")
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.actuate.flyway;
|
package org.springframework.boot.flyway.actuate.endpoint;
|
||||||
|
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
@ -39,7 +39,7 @@ import org.springframework.context.ApplicationContext;
|
||||||
* @author Phillip Webb
|
* @author Phillip Webb
|
||||||
* @author Andy Wilkinson
|
* @author Andy Wilkinson
|
||||||
* @author Artsiom Yudovin
|
* @author Artsiom Yudovin
|
||||||
* @since 2.0.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
@Endpoint(id = "flyway")
|
@Endpoint(id = "flyway")
|
||||||
public class FlywayEndpoint {
|
public class FlywayEndpoint {
|
|
@ -15,6 +15,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Actuator support for Flyway.
|
* Actuator endpoint for Flyway.
|
||||||
*/
|
*/
|
||||||
package org.springframework.boot.actuate.flyway;
|
package org.springframework.boot.flyway.actuate.endpoint;
|
|
@ -14,14 +14,14 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.springframework.boot.actuate.flyway;
|
package org.springframework.boot.flyway.actuate.endpoint;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
import org.springframework.boot.actuate.flyway.FlywayEndpoint.FlywayDescriptor;
|
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
import org.springframework.boot.autoconfigure.AutoConfigurations;
|
||||||
|
import org.springframework.boot.flyway.actuate.endpoint.FlywayEndpoint.FlywayDescriptor;
|
||||||
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
import org.springframework.boot.flyway.autoconfigure.FlywayAutoConfiguration;
|
||||||
import org.springframework.boot.flyway.autoconfigure.FlywayMigrationStrategy;
|
import org.springframework.boot.flyway.autoconfigure.FlywayMigrationStrategy;
|
||||||
import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration;
|
import org.springframework.boot.jdbc.autoconfigure.EmbeddedDataSourceConfiguration;
|
Loading…
Reference in New Issue