Skip to content

Commit

Permalink
Merge pull request #3384 from harawata/testcontainers-replace-depreca…
Browse files Browse the repository at this point in the history
…ted-constructor

Pass docker image name to constructors
  • Loading branch information
harawata authored Jan 4, 2025
2 parents e8bea65 + 7679f60 commit 7a4167d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2024 the original author or authors.
* Copyright 2009-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,7 +36,7 @@ public final class MysqlContainer {

private static MySQLContainer<?> initContainer() {
@SuppressWarnings("resource")
MySQLContainer<?> container = new MySQLContainer<>().withDatabaseName(DB_NAME).withUsername(USERNAME)
MySQLContainer<?> container = new MySQLContainer<>("mysql").withDatabaseName(DB_NAME).withUsername(USERNAME)
.withPassword(PASSWORD).withUrlParam("useSSL", "false");
container.start();
return container;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2024 the original author or authors.
* Copyright 2009-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,8 +31,8 @@ public final class PgContainer {

private static PostgreSQLContainer<?> initContainer() {
@SuppressWarnings("resource")
PostgreSQLContainer<?> container = new PostgreSQLContainer<>().withDatabaseName(DB_NAME).withUsername(USERNAME)
.withPassword(PASSWORD);
PostgreSQLContainer<?> container = new PostgreSQLContainer<>("postgres").withDatabaseName(DB_NAME)
.withUsername(USERNAME).withPassword(PASSWORD);
container.start();
return container;
}
Expand Down

0 comments on commit 7a4167d

Please sign in to comment.