From 4c7896b936c5933e43f32208d7aa35595e9049ee Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 27 Nov 2019 11:01:56 +0100 Subject: [PATCH] Polish "Add support for test containers jdbc url" See gh-19044 --- spring-boot-project/spring-boot/pom.xml | 15 +++++++++++++++ .../boot/jdbc/DatabaseDriverClassNameTests.java | 6 +++--- .../boot/jdbc/DatabaseDriverTests.java | 2 +- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot/pom.xml b/spring-boot-project/spring-boot/pom.xml index cb3d81a582..e42cf62672 100644 --- a/spring-boot-project/spring-boot/pom.xml +++ b/spring-boot-project/spring-boot/pom.xml @@ -472,6 +472,21 @@ spring-data-redis test + + org.testcontainers + jdbc + test + + + javax.annotation + javax.annotation-api + + + javax.xml.bind + jaxb-api + + + org.xerial sqlite-jdbc diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverClassNameTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverClassNameTests.java index 82cfbf564b..92272c0b0a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverClassNameTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverClassNameTests.java @@ -44,9 +44,9 @@ import static org.assertj.core.api.Assertions.assertThat; */ class DatabaseDriverClassNameTests { - private static final Set EXCLUDED_DRIVERS = Collections.unmodifiableSet( - EnumSet.of(DatabaseDriver.UNKNOWN, DatabaseDriver.DB2_AS400, DatabaseDriver.INFORMIX, DatabaseDriver.HANA, - DatabaseDriver.TERADATA, DatabaseDriver.REDSHIFT, DatabaseDriver.TESTCONTAINERS)); + private static final Set EXCLUDED_DRIVERS = Collections + .unmodifiableSet(EnumSet.of(DatabaseDriver.UNKNOWN, DatabaseDriver.DB2_AS400, DatabaseDriver.INFORMIX, + DatabaseDriver.HANA, DatabaseDriver.TERADATA, DatabaseDriver.REDSHIFT)); @ParameterizedTest(name = "{0} {2}") @MethodSource diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java index 7d03ae8339..0307a3a550 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/DatabaseDriverTests.java @@ -112,7 +112,7 @@ class DatabaseDriverTests { assertThat(DatabaseDriver.fromJdbcUrl("jdbc:informix-sqli://localhost:1533/sample")) .isEqualTo(DatabaseDriver.INFORMIX); assertThat(DatabaseDriver.fromJdbcUrl("jdbc:informix-direct://sample")).isEqualTo(DatabaseDriver.INFORMIX); - assertThat(DatabaseDriver.fromJdbcUrl("jdbc:tc:sample://localhost:3306/sample")) + assertThat(DatabaseDriver.fromJdbcUrl("jdbc:tc:mysql://localhost:3306/sample")) .isEqualTo(DatabaseDriver.TESTCONTAINERS); }