From 5fbbad988833c94a5e1b3b0fd821b4f10cd059e2 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 4 May 2021 11:21:33 +0200 Subject: [PATCH] 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. --- .../core/test/repository/MySQLJdbcJobRepositoryTests.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryTests.java index de0b45372..270cb786c 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/MySQLJdbcJobRepositoryTests.java @@ -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; }