Skip to content

Commit

Permalink
Uses TLS 2.1 in JDBC tests (#2628)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon authored Mar 14, 2022
1 parent f896da6 commit 1051406
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions full/src/test/java/apoc/model/ModelTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class ModelTest {

public static JdbcDatabaseContainer mysql;

private static String mysqlUrl;

@BeforeClass
public static void setUpContainer() {
assumeFalse(isRunningInCI());
Expand All @@ -38,6 +40,7 @@ public static void setUpContainer() {
},Exception.class);
assumeNotNull("MySQL container has to exist", mysql);
assumeTrue("MySQL must be running", mysql.isRunning());
mysqlUrl = mysql.getJdbcUrl() + "?enabledTLSProtocols=TLSv1.2";
}

@AfterClass
Expand All @@ -59,7 +62,7 @@ public void initDb() {
@Test
public void testLoadJdbcSchema() {
testCall(db, "CALL apoc.model.jdbc($url, $config)",
Util.map("url", mysql.getJdbcUrl(),
Util.map("url", mysqlUrl,
"config", Util.map("schema", "test",
"credentials", Util.map("user", mysql.getUsername(), "password", mysql.getPassword()))),
(row) -> {
Expand Down Expand Up @@ -111,7 +114,7 @@ public void testLoadJdbcSchema() {
@Test
public void testLoadJdbcSchemaWithWriteOperation() {
db.executeTransactionally("CALL apoc.model.jdbc($url, $config)",
Util.map("url", mysql.getJdbcUrl(),
Util.map("url", mysqlUrl,
"config", Util.map("schema", "test",
"write", true,
"credentials", Util.map("user", mysql.getUsername(), "password", mysql.getPassword()))),
Expand Down Expand Up @@ -165,7 +168,7 @@ public void testLoadJdbcSchemaWithWriteOperation() {
@Test
public void testLoadJdbcSchemaWithFiltering() {
testCall(db, "CALL apoc.model.jdbc($url, $config)",
Util.map("url", mysql.getJdbcUrl(),
Util.map("url", mysqlUrl,
"config", Util.map("schema", "test",
"credentials", Util.map("user", mysql.getUsername(), "password", mysql.getPassword()),
"filters", Util.map("tables", Arrays.asList("country\\w*"), "columns", Arrays.asList("(?i)code", "(?i)name", "(?i)Language")))),
Expand Down

0 comments on commit 1051406

Please sign in to comment.