#350 - Use Testcontainers constructor with image name.
Create database containers using the constructor accepting the image name to make sure that the exposed port gets registered. A recent change in Testcontainers caused that the port is no longer registered when using the default constructor.
This commit is contained in:
@@ -107,7 +107,7 @@ public class MariaDbTestSupport {
|
||||
if (testContainerDatabase == null) {
|
||||
|
||||
try {
|
||||
MariaDBContainer container = new MariaDBContainer();
|
||||
MariaDBContainer container = new MariaDBContainer(MariaDBContainer.IMAGE + ":" + MariaDBContainer.DEFAULT_TAG);
|
||||
container.start();
|
||||
|
||||
testContainerDatabase = ProvidedDatabase.builder(container) //
|
||||
|
||||
@@ -107,7 +107,7 @@ public class MySqlTestSupport {
|
||||
if (testContainerDatabase == null) {
|
||||
|
||||
try {
|
||||
MySQLContainer container = new MySQLContainer();
|
||||
MySQLContainer container = new MySQLContainer(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG);
|
||||
container.start();
|
||||
|
||||
testContainerDatabase = ProvidedDatabase.builder(container) //
|
||||
|
||||
@@ -88,7 +88,8 @@ public class PostgresTestSupport {
|
||||
if (testContainerDatabase == null) {
|
||||
|
||||
try {
|
||||
PostgreSQLContainer container = new PostgreSQLContainer();
|
||||
PostgreSQLContainer container = new PostgreSQLContainer(
|
||||
PostgreSQLContainer.IMAGE + ":" + PostgreSQLContainer.DEFAULT_TAG);
|
||||
container.start();
|
||||
|
||||
testContainerDatabase = ProvidedDatabase.from(container);
|
||||
|
||||
Reference in New Issue
Block a user