diff --git a/spring-cloud-dataflow-build/pom.xml b/spring-cloud-dataflow-build/pom.xml index db6475d4d7..f7ab9d38be 100644 --- a/spring-cloud-dataflow-build/pom.xml +++ b/spring-cloud-dataflow-build/pom.xml @@ -10,7 +10,7 @@ spring-cloud-dataflow-build-dependencies spring-cloud-dataflow-dependencies-parent - + spring-cloud-dataflow-build-tools https://spring.io/projects/spring-cloud-dataflow diff --git a/spring-cloud-dataflow-server/src/main/resources/application.yml b/spring-cloud-dataflow-server/src/main/resources/application.yml index c5ee493e55..bba645577f 100644 --- a/spring-cloud-dataflow-server/src/main/resources/application.yml +++ b/spring-cloud-dataflow-server/src/main/resources/application.yml @@ -3,41 +3,7 @@ info: name: "@project.artifactId@" description: "@project.name@" version: "@project.version@" -#server: -# port: 8443 -# ssl: -# enabled: true -# key-alias: dataflow -# key-store: "/your/path/to/dataflow.keystore" -# key-store-type: jks -# key-store-password: dataflow -# key-password: dataflow - -# Security (Oauth 2): - -#security: -# oauth2: -# client: -# client-id: myclient -# client-secret: mysecret -# access-token-uri: http://127.0.0.1:9999/oauth/token -# user-authorization-uri: http://127.0.0.1:9999/oauth/authorize -# resource: -# user-info-uri: http://127.0.0.1:9999/me -# token-info-uri: http://127.0.0.1:9999/oauth/check_token - -# If you prefer to use Eureka to locate the Config Server, you can do that by setting -# spring.cloud.config.discovery.enabled=true (default "false"). The net result of that is -# that client apps all need a bootstrap.yml (or an environment variable) with the Eureka -# server address, e.g. in eureka.client.serviceUrl.defaultZone -# -#--- -#spring: -# cloud: -# config: -# discovery: -# enabled: true -#eureka: -# client: -# serviceUrl: -# defaultZone: http://localhost:8761/eureka/ +spring: + jpa: + hibernate: + ddl-auto: none \ No newline at end of file diff --git a/spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/db/AbstractPostgresDatabaseTests.java b/spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/db/AbstractPostgresDatabaseTests.java index de23d6db5d..b8e99fa02c 100644 --- a/spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/db/AbstractPostgresDatabaseTests.java +++ b/spring-cloud-dataflow-server/src/test/java/org/springframework/cloud/dataflow/integration/test/db/AbstractPostgresDatabaseTests.java @@ -20,8 +20,6 @@ import java.net.URISyntaxException; import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -36,10 +34,6 @@ import org.springframework.cloud.dataflow.rest.client.DataFlowTemplate; import org.springframework.cloud.dataflow.rest.resource.StreamDefinitionResource; import org.springframework.cloud.dataflow.rest.support.jackson.Jackson2DataflowModule; -import org.springframework.http.ResponseEntity; -import org.springframework.web.client.RestTemplate; -import org.springframework.web.util.UriComponents; -import org.springframework.web.util.UriComponentsBuilder; import static org.assertj.core.api.Assertions.assertThat; @@ -105,7 +99,7 @@ public void testMigration_210_211() throws URISyntaxException { StreamDefinitionResource timelogger = dataFlowTemplate.streamOperations().getStreamDefinition("timelogger"); assertThat(timelogger.getDslText()).isEqualTo("time | log"); assertThat(timelogger.getDescription()).isEqualTo("timelogger"); - + dataFlowTemplate.streamOperations().undeploy("timelogger"); this.dataflowCluster.replaceSkipperAndDataflow(TagNames.SKIPPER_main, TagNames.DATAFLOW_main); assertDataflowServerRunning(this.dataflowCluster); diff --git a/spring-cloud-dataflow-server/src/test/resources/application.properties b/spring-cloud-dataflow-server/src/test/resources/application.properties index 0d7427c621..a4ed36d1f8 100644 --- a/spring-cloud-dataflow-server/src/test/resources/application.properties +++ b/spring-cloud-dataflow-server/src/test/resources/application.properties @@ -1,6 +1,6 @@ spring.datasource.url=jdbc:h2:mem:testdb spring.cloud.dataflow.client.skip-ssl-validation=true spring.autoconfigure.exclude=org.springframework.cloud.dataflow.rest.client.config.DataFlowClientAutoConfiguration -spring.jpa.hibernate.ddl-auto=validate +spring.jpa.hibernate.ddl-auto=none logging.level.root=info diff --git a/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLTextToOID.java b/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLTextToOID.java index 41300186f6..e9f17b8675 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLTextToOID.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLTextToOID.java @@ -17,8 +17,10 @@ package org.springframework.cloud.skipper.server.db.migration; import java.sql.Connection; +import java.sql.JDBCType; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Types; import javax.sql.DataSource; @@ -52,9 +54,9 @@ public static void convertColumnToOID(String table, String id, String column, Da try (Connection connection = dataSource.getConnection()) { try (ResultSet resultSet = connection.getMetaData().getColumns(null, null, table.toUpperCase(), column.toUpperCase())) { while (resultSet.next()) { - String dataType = resultSet.getString("DATA_TYPE"); - if (dataType.equalsIgnoreCase("OID")) { - logger.info("Found {}:{}:{}", table, column, dataType); + int dataType = resultSet.getInt("DATA_TYPE"); + logger.info("Found {}:{}:{}", table, column, JDBCType.valueOf(dataType)); + if (dataType == Types.BIGINT) { return; } } @@ -90,9 +92,9 @@ public static void convertColumnFromOID(String table, String id, String column, try (Connection connection = dataSource.getConnection()) { try (ResultSet resultSet = connection.getMetaData().getColumns(null, null, table.toUpperCase(), column.toUpperCase())) { while (resultSet.next()) { - String dataType = resultSet.getString("DATA_TYPE"); - if (!dataType.equalsIgnoreCase("OID")) { - logger.info("Found {}:{}:{}", table, column, dataType); + int dataType = resultSet.getInt("DATA_TYPE"); + logger.info("Found {}:{}:{}", table, column, JDBCType.valueOf(dataType)); + if (dataType != Types.BIGINT) { return; } } diff --git a/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/postgresql/V3__ChangeTextTypes.java b/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/postgresql/V3__ChangeTextTypes.java index a8dcef4691..41460c2480 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/postgresql/V3__ChangeTextTypes.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server-core/src/main/java/org/springframework/cloud/skipper/server/db/migration/postgresql/V3__ChangeTextTypes.java @@ -18,8 +18,8 @@ import org.flywaydb.core.api.migration.Context; import org.springframework.cloud.dataflow.common.flyway.AbstractMigration; -import org.springframework.cloud.skipper.server.db.migration.PostgreSQLTextToOID; +import static org.springframework.cloud.skipper.server.db.migration.PostgreSQLTextToOID.convertColumnFromOID; public class V3__ChangeTextTypes extends AbstractMigration { public V3__ChangeTextTypes() { super(null); @@ -27,16 +27,16 @@ public V3__ChangeTextTypes() { @Override public void migrate(Context context) { - PostgreSQLTextToOID.convertColumnFromOID("skipper_app_deployer_data", "id", "deployment_data", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_package_metadata", "id", "description", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_package_metadata", "id", "icon_url", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_package_metadata", "id", "package_home_url", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_package_metadata", "id", "package_source_url", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_package_metadata", "id", "tags", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_release", "id", "config_values_string", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_release", "id", "pkg_json_string", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_repository", "id", "source_url", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_repository", "id", "url", context.getConfiguration().getDataSource()); - PostgreSQLTextToOID.convertColumnFromOID("skipper_status", "id", "platform_status", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_app_deployer_data", "id", "deployment_data", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_package_metadata", "id", "description", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_package_metadata", "id", "icon_url", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_package_metadata", "id", "package_home_url", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_package_metadata", "id", "package_source_url", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_package_metadata", "id", "tags", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_release", "id", "config_values_string", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_release", "id", "pkg_json_string", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_repository", "id", "source_url", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_repository", "id", "url", context.getConfiguration().getDataSource()); + convertColumnFromOID("skipper_status", "id", "platform_status", context.getConfiguration().getDataSource()); } } diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSkipperSmokeTest.java similarity index 95% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSkipperSmokeTest.java index 5e30670c24..152826896a 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/AbstractSkipperSmokeTest.java @@ -49,15 +49,15 @@ * * @author Corneil du Plessis */ -@SpringBootTest(classes = AbstractSmokeTest.LocalTestSkipperServer.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@SpringBootTest(classes = AbstractSkipperSmokeTest.LocalTestSkipperServer.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) @ActiveProfiles({"local", "repo-test"}) @TestPropertySource(properties = { "spring.jpa.hibernate.ddl-auto=none", "logging.level.org.springframework.cloud=info", "logging.level.org.hibernate=debug" }) -public abstract class AbstractSmokeTest { - private static final Logger logger = LoggerFactory.getLogger(AbstractSmokeTest.class); +public abstract class AbstractSkipperSmokeTest { + private static final Logger logger = LoggerFactory.getLogger(AbstractSkipperSmokeTest.class); protected static JdbcDatabaseContainer container; diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SkipperSmokeTest.java similarity index 94% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SkipperSmokeTest.java index cf11e44e88..b0ae2ef07b 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/DB2SkipperSmokeTest.java @@ -25,7 +25,7 @@ * * @author Corneil du Plessis */ -public class DB2SmokeTest extends AbstractSmokeTest { +public class DB2SkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { container = new Db2Container( diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSkipperSmokeTest.java similarity index 94% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSkipperSmokeTest.java index 2c68538d2f..98bfb29441 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MariaDBSkipperSmokeTest.java @@ -30,7 +30,7 @@ @TestPropertySource(properties = { "spring.jpa.database-platform=org.hibernate.dialect.MariaDB106Dialect" }) -public class MariaDBSmokeTest extends AbstractSmokeTest { +public class MariaDBSkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SkipperSmokeTest.java similarity index 93% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SkipperSmokeTest.java index fb0fa01f96..efb7c4b21b 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL57SkipperSmokeTest.java @@ -23,7 +23,7 @@ * * @author Corneil du Plessis */ -public class MySQL57SmokeTest extends AbstractSmokeTest { +public class MySQL57SkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { container = new MySQLContainer<>("mysql:5.7"); diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SkipperSmokeTest.java similarity index 93% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SkipperSmokeTest.java index f35d312878..9e1bd05b8a 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/MySQL8SkipperSmokeTest.java @@ -24,7 +24,7 @@ * * @author Corneil du Plessis */ -public class MySQL8SmokeTest extends AbstractSmokeTest { +public class MySQL8SkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { container = new MySQLContainer<>(DockerImageName.parse("mysql:8")); diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSkipperSmokeTest.java similarity index 93% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSkipperSmokeTest.java index 9990f1c67a..95efb5bf07 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/OracleSkipperSmokeTest.java @@ -24,7 +24,7 @@ * * @author Corneil du Plessis */ -public class OracleSmokeTest extends AbstractSmokeTest { +public class OracleSkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { container = new OracleContainer(); diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSkipperSmokeTest.java similarity index 93% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSkipperSmokeTest.java index 91bdd249d3..d9e0397b77 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/PostgreSQLSkipperSmokeTest.java @@ -25,7 +25,7 @@ * * @author Corneil du Plessis */ -public class PostgreSQLSmokeTest extends AbstractSmokeTest { +public class PostgreSQLSkipperSmokeTest extends AbstractSkipperSmokeTest { @BeforeAll static void startContainer() { container = new PostgreSQLContainer<>(DockerImageName.parse("postgres:14")); diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSmokeTest.java b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSkipperSmokeTest.java similarity index 94% rename from spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSmokeTest.java rename to spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSkipperSmokeTest.java index 798669a22d..7a0d3a4589 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSmokeTest.java +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/java/org/springframework/cloud/skipper/server/db/migration/SqlServerSkipperSmokeTest.java @@ -25,7 +25,7 @@ * * @author Corneil du Plessis */ -public class SqlServerSmokeTest extends AbstractSmokeTest { +public class SqlServerSkipperSmokeTest extends AbstractSkipperSmokeTest { @SuppressWarnings("resource") @BeforeAll static void startContainer() { diff --git a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/resources/logback-test.xml b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/resources/logback-test.xml index df5678f575..8ae190e25e 100644 --- a/spring-cloud-skipper/spring-cloud-skipper-server/src/test/resources/logback-test.xml +++ b/spring-cloud-skipper/spring-cloud-skipper-server/src/test/resources/logback-test.xml @@ -2,7 +2,7 @@ - + diff --git a/spring-cloud-skipper/spring-cloud-starter-skipper-server/pom.xml b/spring-cloud-skipper/spring-cloud-starter-skipper-server/pom.xml index 0967bba5a8..4441aad43f 100644 --- a/spring-cloud-skipper/spring-cloud-starter-skipper-server/pom.xml +++ b/spring-cloud-skipper/spring-cloud-starter-skipper-server/pom.xml @@ -1,16 +1,15 @@ 4.0.0 - spring-cloud-starter-skipper-server - pom - Spring Cloud Starter :: Skipper Server - org.springframework.cloud spring-cloud-skipper-parent 2.11.0-SNAPSHOT .. + spring-cloud-starter-skipper-server + jar + Spring Cloud Starter :: Skipper Server 3.4.1