Skip to content

Commit 7a4167d

Browse files
authored
Merge pull request #3384 from harawata/testcontainers-replace-deprecated-constructor
Pass docker image name to constructors
2 parents e8bea65 + 7679f60 commit 7a4167d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/test/java/org/apache/ibatis/testcontainers/MysqlContainer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2024 the original author or authors.
2+
* Copyright 2009-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@ public final class MysqlContainer {
3636

3737
private static MySQLContainer<?> initContainer() {
3838
@SuppressWarnings("resource")
39-
MySQLContainer<?> container = new MySQLContainer<>().withDatabaseName(DB_NAME).withUsername(USERNAME)
39+
MySQLContainer<?> container = new MySQLContainer<>("mysql").withDatabaseName(DB_NAME).withUsername(USERNAME)
4040
.withPassword(PASSWORD).withUrlParam("useSSL", "false");
4141
container.start();
4242
return container;

src/test/java/org/apache/ibatis/testcontainers/PgContainer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2009-2024 the original author or authors.
2+
* Copyright 2009-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -31,8 +31,8 @@ public final class PgContainer {
3131

3232
private static PostgreSQLContainer<?> initContainer() {
3333
@SuppressWarnings("resource")
34-
PostgreSQLContainer<?> container = new PostgreSQLContainer<>().withDatabaseName(DB_NAME).withUsername(USERNAME)
35-
.withPassword(PASSWORD);
34+
PostgreSQLContainer<?> container = new PostgreSQLContainer<>("postgres").withDatabaseName(DB_NAME)
35+
.withUsername(USERNAME).withPassword(PASSWORD);
3636
container.start();
3737
return container;
3838
}

0 commit comments

Comments
 (0)