File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
modules/mongodb/src/test/java/org/testcontainers/mongodb Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change 22
33import org .junit .jupiter .api .Test ;
44
5- import java .time .Duration ;
6-
75import static org .assertj .core .api .Assertions .assertThat ;
86
97class MongoDBContainerTest extends AbstractMongo {
@@ -43,22 +41,16 @@ void shouldTestDatabaseName() {
4341
4442 @ Test
4543 void shouldExecuteInitScript () {
46- try (
47- MongoDBContainer mongoDB = new MongoDBContainer ("mongo:4.0.10" )
48- .withInitScript ("init.js" )
49- .withStartupTimeout (Duration .ofSeconds (30 ))
50- ) {
44+ try (MongoDBContainer mongoDB = new MongoDBContainer ("mongo:4.0.10" ).withInitScript ("init.js" )) {
5145 mongoDB .start ();
52- assertThat (mongoDB . isRunning ()). isTrue ( );
46+ assertInitScriptExecuted (mongoDB );
5347 }
5448 }
5549
5650 @ Test
5751 void shouldExecuteInitScriptWithEdgeCases () {
5852 try (
59- MongoDBContainer mongoDB = new MongoDBContainer ("mongo:4.0.10" )
60- .withInitScript ("initEdgeCase!@#%^& *'().js" )
61- .withStartupTimeout (Duration .ofSeconds (30 ))
53+ MongoDBContainer mongoDB = new MongoDBContainer ("mongo:4.0.10" ).withInitScript ("initEdgeCase!@#%^& *'().js" )
6254 ) {
6355 mongoDB .start ();
6456
You can’t perform that action at this time.
0 commit comments