Merge pull request #19044 from polarbear567
* pr/19044: Polish "Add support for test containers jdbc url" Add support for test containers jdbc url Closes gh-19044
This commit is contained in:
@@ -472,6 +472,21 @@
|
||||
<artifactId>spring-data-redis</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>jdbc</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
|
||||
@@ -196,6 +196,18 @@ public enum DatabaseDriver {
|
||||
return Arrays.asList("informix-sqli", "informix-direct");
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Testcontainers.
|
||||
*/
|
||||
TESTCONTAINERS(null, "org.testcontainers.jdbc.ContainerDatabaseDriver") {
|
||||
|
||||
@Override
|
||||
protected Collection<String> getUrlPrefixes() {
|
||||
return Collections.singleton("tc");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private final String productName;
|
||||
|
||||
@@ -112,6 +112,8 @@ 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:mysql://localhost:3306/sample"))
|
||||
.isEqualTo(DatabaseDriver.TESTCONTAINERS);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user