Skip to content

Commit

Permalink
πŸ‘½ : correct port mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
juwit committed Aug 5, 2022
1 parent 6136241 commit fb48a86
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/java/io/gaia_app/test/MongoContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class MongoContainer extends GenericContainer {

public MongoContainer() {
super("mongo:4.4");
this.addExposedPort(MONGO_PORT);
withClasspathResourceMapping("db", GAIA_SCRIPTS_DIRECTORY, BindMode.READ_ONLY);
}

Expand All @@ -35,7 +36,7 @@ public MongoClient getClient() {
}

public String connectionURL(){
return String.format("mongodb://%s:%d/gaia",this.getContainerIpAddress(), getMappedPort(MONGO_PORT));
return String.format("mongodb://%s:%d/gaia",this.getHost(), getFirstMappedPort());
}

public MongoDatabase getDatabase() {
Expand Down

0 comments on commit fb48a86

Please sign in to comment.