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.
This commit is contained in:
Mahmoud Ben Hassine
2021-05-04 11:21:33 +02:00
parent e401f99f7d
commit 5fbbad9888

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2020 the original author or authors.
* Copyright 2020-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -116,11 +116,12 @@ public class MySQLJdbcJobRepositoryTests {
static class TestConfiguration {
@Bean
public DataSource dataSource() {
public DataSource dataSource() throws Exception {
MysqlDataSource datasource = new MysqlDataSource();
datasource.setURL(mysql.getJdbcUrl());
datasource.setUser(mysql.getUsername());
datasource.setPassword(mysql.getPassword());
datasource.setUseSSL(false);
return datasource;
}