Skip to content

Commit c3b2e26

Browse files
committed
Disable SSL usage in MySQL test container
By default, testcontainers does not use SSL. This commit disable SSL usage in the datasource configuration to prevent `SSLHandshakeException`s.
1 parent ad0fd05 commit c3b2e26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -115,11 +115,12 @@ public void testDateMillisecondPrecision() throws Exception {
115115
static class TestConfiguration {
116116

117117
@Bean
118-
public DataSource dataSource() {
118+
public DataSource dataSource() throws Exception {
119119
MysqlDataSource datasource = new MysqlDataSource();
120120
datasource.setURL(mysql.getJdbcUrl());
121121
datasource.setUser(mysql.getUsername());
122122
datasource.setPassword(mysql.getPassword());
123+
datasource.setUseSSL(false);
123124
return datasource;
124125
}
125126

0 commit comments

Comments
 (0)