File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
spring-data-jdbc/src/test/java/org/springframework/data/jdbc/testing Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
22
33{
4- echo " mcr.microsoft.com/mssql/server:2017-CU12 "
4+ echo " mcr.microsoft.com/mssql/server:2019-CU16-ubuntu-20.04 "
55 echo " ibmcom/db2:11.5.7.0a"
66} > spring-data-jdbc/src/test/resources/container-license-acceptance.txt
Original file line number Diff line number Diff line change 2525import org .testcontainers .containers .MSSQLServerContainer ;
2626import org .testcontainers .utility .LicenseAcceptance ;
2727
28+ import static org .springframework .data .jdbc .testing .MsSqlDataSourceConfiguration .*;
29+
2830/**
2931 * {@link TestExecutionListener} to selectively skip tests if the license for a particular database container was not
3032 * accepted.
@@ -47,7 +49,7 @@ public void prepareTestInstance(TestContext testContext) {
4749 }
4850
4951 if (environment .acceptsProfiles (Profiles .of ("mssql" ))) {
50- assumeLicenseAccepted (MSSQLServerContainer . IMAGE + ":" + MSSQLServerContainer . DEFAULT_TAG );
52+ assumeLicenseAccepted (MS_SQL_SERVER_VERSION );
5153 }
5254 }
5355
Original file line number Diff line number Diff line change 3939@ Profile ({"mssql" })
4040public class MsSqlDataSourceConfiguration extends DataSourceConfiguration {
4141
42+ public static final String MS_SQL_SERVER_VERSION = "mcr.microsoft.com/mssql/server:2019-CU16-ubuntu-20.04" ;
4243 private static MSSQLServerContainer <?> MSSQL_CONTAINER ;
4344
4445 @ Override
4546 protected DataSource createDataSource () {
4647
4748 if (MSSQL_CONTAINER == null ) {
4849
49- MSSQLServerContainer <?> container = new MSSQLServerContainer <>() //
50+ MSSQLServerContainer <?> container = new MSSQLServerContainer <>(MS_SQL_SERVER_VERSION ) //
5051 .withReuse (true );
5152 container .start ();
5253
You can’t perform that action at this time.
0 commit comments