From 7679f6092a8523b4ecb8b35aa8e669318e6f4b04 Mon Sep 17 00:00:00 2001 From: Iwao AVE! Date: Sun, 5 Jan 2025 06:09:26 +0900 Subject: [PATCH] Pass docker image name to constructors No-arg constructors are deprecated. --- .../org/apache/ibatis/testcontainers/MysqlContainer.java | 4 ++-- .../java/org/apache/ibatis/testcontainers/PgContainer.java | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/test/java/org/apache/ibatis/testcontainers/MysqlContainer.java b/src/test/java/org/apache/ibatis/testcontainers/MysqlContainer.java index ca055ed76b2..99c7a090cb9 100644 --- a/src/test/java/org/apache/ibatis/testcontainers/MysqlContainer.java +++ b/src/test/java/org/apache/ibatis/testcontainers/MysqlContainer.java @@ -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. @@ -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; diff --git a/src/test/java/org/apache/ibatis/testcontainers/PgContainer.java b/src/test/java/org/apache/ibatis/testcontainers/PgContainer.java index f0184724702..b33e3c8fb8c 100644 --- a/src/test/java/org/apache/ibatis/testcontainers/PgContainer.java +++ b/src/test/java/org/apache/ibatis/testcontainers/PgContainer.java @@ -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. @@ -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; }