66import org .junit .jupiter .api .Test ;
77import org .springframework .beans .factory .annotation .Autowired ;
88import org .springframework .boot .data .mongodb .test .autoconfigure .DataMongoTest ;
9+ import org .springframework .boot .test .context .TestConfiguration ;
910import org .springframework .context .annotation .Import ;
1011import org .springframework .data .mongodb .core .ReactiveMongoTemplate ;
12+ import org .springframework .test .context .DynamicPropertyRegistry ;
13+ import org .springframework .test .context .DynamicPropertySource ;
14+ import org .testcontainers .junit .jupiter .Container ;
15+ import org .testcontainers .junit .jupiter .Testcontainers ;
16+ import org .testcontainers .mongodb .MongoDBContainer ;
1117import reactor .core .publisher .Flux ;
1218import reactor .test .StepVerifier ;
1319
@@ -32,17 +38,17 @@ public class PostRepositoryTest {
3238 @ SneakyThrows
3339 @ BeforeEach
3440 public void setup () {
35- var latch = new CountDownLatch (1 );
41+ var latch = new CountDownLatch (1 );
3642 this .reactiveMongoTemplate .remove (Post .class ).all ()
3743 .subscribe (
38- r -> {
39- log .debug ("delete all posts: " + r );
40- latch .countDown ();
41- },
42- e -> log .debug ("error: " + e ),
43- () -> log .debug ("done" )
44- );
45- latch .await (500 , TimeUnit .MILLISECONDS );
44+ r -> {
45+ log .debug ("delete all posts: " + r );
46+ latch .countDown ();
47+ },
48+ e -> log .debug ("error: " + e ),
49+ () -> log .debug ("done" )
50+ );
51+ latch .await (500 , TimeUnit .MILLISECONDS );
4652 }
4753
4854 @ Test
0 commit comments