1+ package  com .nihat .springwebfluxdemo .controllers .mvc ;
2+ 3+ import  com .nihat .springwebfluxdemo .model .ProductDTO ;
4+ import  com .nihat .springwebfluxdemo .services .ProductService ;
5+ import  org .junit .jupiter .api .MethodOrderer ;
6+ import  org .junit .jupiter .api .TestMethodOrder ;
7+ import  org .springframework .beans .factory .annotation .Autowired ;
8+ import  org .springframework .boot .test .autoconfigure .web .reactive .AutoConfigureWebTestClient ;
9+ import  org .springframework .boot .test .context .SpringBootTest ;
10+ import  org .springframework .test .web .reactive .server .WebTestClient ;
11+ 12+ import  static  org .junit .jupiter .api .Assertions .*;
13+ 14+ @ SpringBootTest 
15+ @ AutoConfigureWebTestClient 
16+ @ TestMethodOrder (MethodOrderer .OrderAnnotation .class )
17+ class  ProductControllerTest  {
18+ 19+  @ Autowired 
20+  WebTestClient  webTestClient ;
21+ 22+  @ Autowired 
23+  ProductService  productService ;
24+ 25+ 26+  private  ProductDTO  getSavedTestProduct () {
27+  return  productService .getAllProducts ().next ().block ();
28+  }
29+ 30+ 31+ }
0 commit comments