Skip to content

Commit

Permalink
Use newer versions of containers
Browse files Browse the repository at this point in the history
The default testcontainers versions are quite old,
and newer JDK11 releases no longer have compatible
ciphers, which means connections will fail.
  • Loading branch information
stuartwdouglas committed Apr 23, 2021
1 parent 2d08959 commit 4e90459
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

public class DB2DevServicesProcessor {

public static final String TAG = "11.5.5.1";

@BuildStep
DevServicesDatasourceProviderBuildItem setupDB2() {
return new DevServicesDatasourceProviderBuildItem(DatabaseKind.DB2, new DevServicesDatasourceProvider() {
@Override
public RunningDevServicesDatasource startDatabase(Optional<String> username, Optional<String> password,
Optional<String> datasourceName, Optional<String> imageName, Map<String, String> additionalProperties) {
Db2Container container = new Db2Container(
DockerImageName.parse(imageName.orElse("ibmcom/db2:" + Db2Container.DEFAULT_TAG))
DockerImageName.parse(imageName.orElse("ibmcom/db2:" + TAG))
.asCompatibleSubstituteFor(DockerImageName.parse("ibmcom/db2")))
.withPassword(password.orElse("quarkus"))
.withUsername(username.orElse("quarkus"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

public class MariaDBDevServicesProcessor {

public static final String TAG = "10.5.9";

@BuildStep
DevServicesDatasourceProviderBuildItem setupMariaDB() {
return new DevServicesDatasourceProviderBuildItem(DatabaseKind.MARIADB, new DevServicesDatasourceProvider() {
@Override
public RunningDevServicesDatasource startDatabase(Optional<String> username, Optional<String> password,
Optional<String> datasourceName, Optional<String> imageName, Map<String, String> additionalProperties) {
MariaDBContainer container = new MariaDBContainer(
DockerImageName.parse(imageName.orElse(MariaDBContainer.IMAGE + ":" + MariaDBContainer.DEFAULT_TAG))
DockerImageName.parse(imageName.orElse(MariaDBContainer.IMAGE + ":" + TAG))
.asCompatibleSubstituteFor(DockerImageName.parse(MariaDBContainer.IMAGE)))
.withPassword(password.orElse("quarkus"))
.withUsername(username.orElse("quarkus"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

public class MSSQLDevServicesProcessor {

public static final String TAG = "2019-CU10-ubuntu-20.04";

@BuildStep
DevServicesDatasourceProviderBuildItem setupMSSQL() {
return new DevServicesDatasourceProviderBuildItem(DatabaseKind.MSSQL, new DevServicesDatasourceProvider() {
Expand All @@ -24,7 +26,7 @@ public RunningDevServicesDatasource startDatabase(Optional<String> username, Opt
Optional<String> datasourceName, Optional<String> imageName, Map<String, String> additionalProperties) {
JdbcDatabaseContainer container = new MSSQLServerContainer(
DockerImageName
.parse(imageName.orElse(MSSQLServerContainer.IMAGE + ":" + MSSQLServerContainer.DEFAULT_TAG))
.parse(imageName.orElse(MSSQLServerContainer.IMAGE + ":" + TAG))
.asCompatibleSubstituteFor(MSSQLServerContainer.IMAGE))
.withPassword(password.orElse("Quarkuspassword1"));
additionalProperties.forEach(container::withUrlParam);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@

public class MySQLDevServicesProcessor {

public static final String TAG = "8.0.24";

@BuildStep
DevServicesDatasourceProviderBuildItem setupMysql() {
return new DevServicesDatasourceProviderBuildItem(DatabaseKind.MYSQL, new DevServicesDatasourceProvider() {
@Override
public RunningDevServicesDatasource startDatabase(Optional<String> username, Optional<String> password,
Optional<String> datasourceName, Optional<String> imageName, Map<String, String> additionalProperties) {
MySQLContainer container = new MySQLContainer(
DockerImageName.parse(imageName.orElse(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG))
DockerImageName.parse(imageName.orElse(MySQLContainer.IMAGE + ":" + TAG))
.asCompatibleSubstituteFor(DockerImageName.parse(MySQLContainer.IMAGE)))
.withPassword(password.orElse("quarkus"))
.withUsername(username.orElse("quarkus"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class PostgresqlDevServicesProcessor {

public static final String DEFAULT = PostgreSQLContainer.IMAGE + ":" + PostgreSQLContainer.DEFAULT_TAG;
public static final String TAG = "13.2";

@BuildStep
DevServicesDatasourceProviderBuildItem setupPostgres() {
Expand All @@ -24,7 +24,7 @@ DevServicesDatasourceProviderBuildItem setupPostgres() {
public RunningDevServicesDatasource startDatabase(Optional<String> username, Optional<String> password,
Optional<String> datasourceName, Optional<String> imageName, Map<String, String> additionalProperties) {
PostgreSQLContainer container = new PostgreSQLContainer(
DockerImageName.parse(imageName.orElse(DEFAULT))
DockerImageName.parse(imageName.orElse(PostgreSQLContainer.IMAGE + ":" + TAG))
.asCompatibleSubstituteFor(DockerImageName.parse(PostgreSQLContainer.IMAGE)))
.withPassword(password.orElse("quarkus"))
.withUsername(username.orElse("quarkus"))
Expand Down

0 comments on commit 4e90459

Please sign in to comment.