Skip to content

Commit

Permalink
#350 - Use Testcontainers constructor with image name.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mp911de committed Apr 20, 2020
1 parent 6cf4ae1 commit ee46695
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Expand Up @@ -107,7 +107,7 @@ private static ExternalDatabase testContainer() {
if (testContainerDatabase == null) {

try {
MariaDBContainer container = new MariaDBContainer();
MariaDBContainer container = new MariaDBContainer(MariaDBContainer.IMAGE + ":" + MariaDBContainer.DEFAULT_TAG);
container.start();

testContainerDatabase = ProvidedDatabase.builder(container) //
Expand Down
Expand Up @@ -107,7 +107,7 @@ private static ExternalDatabase testContainer() {
if (testContainerDatabase == null) {

try {
MySQLContainer container = new MySQLContainer();
MySQLContainer container = new MySQLContainer(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG);
container.start();

testContainerDatabase = ProvidedDatabase.builder(container) //
Expand Down
Expand Up @@ -88,7 +88,8 @@ private static ExternalDatabase testContainer() {
if (testContainerDatabase == null) {

try {
PostgreSQLContainer container = new PostgreSQLContainer();
PostgreSQLContainer container = new PostgreSQLContainer(
PostgreSQLContainer.IMAGE + ":" + PostgreSQLContainer.DEFAULT_TAG);
container.start();

testContainerDatabase = ProvidedDatabase.from(container);
Expand Down

0 comments on commit ee46695

Please sign in to comment.