Upgrade MS SQL Server Docker image version to 2019-CU16-ubuntu-20.04

Closes #1283
This commit is contained in:
Jens Schauder
2022-07-04 14:59:12 +02:00
parent 09c3088a78
commit dd663384ac
3 changed files with 6 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
{
echo "mcr.microsoft.com/mssql/server:2017-CU12"
echo "mcr.microsoft.com/mssql/server:2019-CU16-ubuntu-20.04"
echo "ibmcom/db2:11.5.7.0a"
} > spring-data-jdbc/src/test/resources/container-license-acceptance.txt

View File

@@ -25,6 +25,8 @@ import org.testcontainers.containers.Db2Container;
import org.testcontainers.containers.MSSQLServerContainer;
import org.testcontainers.utility.LicenseAcceptance;
import static org.springframework.data.jdbc.testing.MsSqlDataSourceConfiguration.*;
/**
* {@link TestExecutionListener} to selectively skip tests if the license for a particular database container was not
* accepted.
@@ -47,7 +49,7 @@ public class LicenseListener implements TestExecutionListener {
}
if (environment.acceptsProfiles(Profiles.of("mssql"))) {
assumeLicenseAccepted(MSSQLServerContainer.IMAGE + ":" + MSSQLServerContainer.DEFAULT_TAG);
assumeLicenseAccepted(MS_SQL_SERVER_VERSION);
}
}

View File

@@ -39,6 +39,7 @@ import com.microsoft.sqlserver.jdbc.SQLServerDataSource;
@Profile({"mssql"})
public class MsSqlDataSourceConfiguration extends DataSourceConfiguration {
public static final String MS_SQL_SERVER_VERSION = "mcr.microsoft.com/mssql/server:2019-CU16-ubuntu-20.04";
private static MSSQLServerContainer<?> MSSQL_CONTAINER;
@Override
@@ -46,7 +47,7 @@ public class MsSqlDataSourceConfiguration extends DataSourceConfiguration {
if (MSSQL_CONTAINER == null) {
MSSQLServerContainer<?> container = new MSSQLServerContainer<>() //
MSSQLServerContainer<?> container = new MSSQLServerContainer<>(MS_SQL_SERVER_VERSION) //
.withReuse(true);
container.start();