Skip to content

Commit ed367bd

Browse files
authored
Merge pull request #178 from testcontainers/java_11_for_ci
Using Java 11 for CI
2 parents e64ef0d + 68a77a2 commit ed367bd

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ jobs:
1111
matrix:
1212
os: [ubuntu-latest]
1313
java:
14-
14+
- 11
1515
1616
runs-on: ${{ matrix.os }}
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v2
2020

2121
- name: Setup Java
22-
uses: olafurpg/setup-scala@v10
22+
uses: actions/setup-java@v2
2323
with:
24+
distribution: 'adopt' # See 'Supported distributions' for available options
2425
java-version: ${{ matrix.java }}
2526

2627
- name: Restore cache

modules/mysql/src/test/scala/com/dimafeng/testcontainers/MysqlSpec.scala

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
package com.dimafeng.testcontainers
22

33
import java.sql.DriverManager
4-
54
import org.scalatest.flatspec.AnyFlatSpec
5+
import org.testcontainers.utility.DockerImageName
6+
7+
import java.util.Properties
68

79
class MysqlSpec extends AnyFlatSpec with ForAllTestContainer {
810

9-
override val container: MySQLContainer = MySQLContainer()
11+
override val container: MySQLContainer = MySQLContainer(mysqlImageVersion = DockerImageName.parse("mysql:5.7.34"))
1012

1113
"Mysql container" should "be started" in {
1214
Class.forName(container.driverClassName)
13-
val connection = DriverManager.getConnection(container.jdbcUrl, container.username, container.password)
15+
val properties = new Properties();
16+
properties.setProperty("user", container.username);
17+
properties.setProperty("password", container.password)
18+
properties.setProperty("useSSL", "false")
19+
val connection = DriverManager.getConnection(container.jdbcUrl, properties)
1420

1521
val prepareStatement = connection.prepareStatement("select 1")
1622
try {

0 commit comments

Comments
 (0)