Skip to content

Commit

Permalink
deps: update MongoDb image version to 6.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Dec 7, 2023
1 parent 47b8bd7 commit 104d65b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import org.testcontainers.utility.DockerImageName;

public class MongoLauncher {
private static final String DEV_CONNECTION_STRING = "mongodb://root:root@localhost";
private static final String CONNECTION_OPTIONS = "/?connectTimeoutMS=300000&maxIdleTimeMS=300000";
private static final String DEV_CONNECTION_STRING = "mongodb://root:root@localhost" + CONNECTION_OPTIONS;
private static final MongoDBContainer MONGO_CONTAINER = new MongoDBContainer(DockerImageName.parse("mongo:6.0.12"))
.withNetworkAliases("mongo")
.withReuse(true);
Expand All @@ -29,6 +30,7 @@ public static String getConnectionString() {
return DEV_CONNECTION_STRING;
}
MONGO_CONTAINER.start();
return MONGO_CONTAINER.getConnectionString();
return MONGO_CONTAINER.getConnectionString() + CONNECTION_OPTIONS;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import org.testcontainers.utility.DockerImageName;

public class MongoLauncher {
private static final String DEV_CONNECTION_STRING = "mongodb://root:root@localhost";
private static final String CONNECTION_OPTIONS = "/?connectTimeoutMS=300000&maxIdleTimeMS=300000";
private static final String DEV_CONNECTION_STRING = "mongodb://root:root@localhost" + CONNECTION_OPTIONS;
private static final MongoDBContainer MONGO_CONTAINER = new MongoDBContainer(DockerImageName.parse("mongo:6.0.12"))
.withNetworkAliases("mongo")
.withReuse(true);
Expand All @@ -29,6 +30,7 @@ public static String getConnectionString() {
return DEV_CONNECTION_STRING;
}
MONGO_CONTAINER.start();
return MONGO_CONTAINER.getConnectionString();
return MONGO_CONTAINER.getConnectionString() + CONNECTION_OPTIONS;

}
}

0 comments on commit 104d65b

Please sign in to comment.