Skip to content

Commit

Permalink
Upgrade the MSSQL test container for compatibility with Linux 6.7. (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
jnturton authored Oct 9, 2024
1 parent 11aaa3f commit cd8127c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@
import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.testcontainers.containers.MSSQLServerContainer;
import org.testcontainers.utility.DockerImageName;

import java.math.BigDecimal;
import java.util.TimeZone;
Expand All @@ -58,14 +60,16 @@ public static void initMSSQL() throws Exception {
startCluster(ClusterFixture.builder(dirTestWatcher));
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));

jdbcContainer = new MSSQLServerContainer<>()
.withPassword("B!llyG0atGruff") // must meet mssql's complexity requirements
jdbcContainer = new MSSQLServerContainer<>(
DockerImageName.parse("mcr.microsoft.com/mssql/server:2022-latest")
);

jdbcContainer
.withPassword("B!llyG0atGruff") // must meet mssql's complexity requirements
.withInitScript("mssql-test-data.ms.sql")
.withUrlParam("trustServerCertificate", "true")
.acceptLicense();

jdbcContainer.start();
.acceptLicense()
.start();

Map<String, String> credentials = ImmutableMap.<String, String>builder()
.put("username", jdbcContainer.getUsername())
Expand Down Expand Up @@ -275,12 +279,14 @@ public void testSemiJoin() throws Exception {
}

@Test
@Ignore("Incompatible with MSSQL >= 2019, duplicate names returned.")
public void testInformationSchemaViews() throws Exception {
String query = "select * from information_schema.`views`";
run(query);
}

@Test
@Ignore("Incompatible with MSSQL >= 2019, duplicate names returned.")
public void testJdbcTableTypes() throws Exception {
String query = "select distinct table_type from information_schema.`tables` " +
"where table_schema like 'mssql%'";
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<surefire.version>3.1.2</surefire.version>
<swagger.version>2.1.12</swagger.version>
<target.gen.source.path>${project.basedir}/target/generated-sources</target.gen.source.path>
<testcontainers.version>1.18.3</testcontainers.version>
<testcontainers.version>1.20.0</testcontainers.version>
<typesafe.config.version>1.4.2</typesafe.config.version>
<univocity-parsers.version>2.8.3</univocity-parsers.version>
<wiremock.standalone.version>2.23.2</wiremock.standalone.version>
Expand Down

0 comments on commit cd8127c

Please sign in to comment.