File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
4-reactive/src/test/java/com/greglturnquist/hackingspringboot/reactive Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 24
24
import org .springframework .test .web .reactive .server .WebTestClient ;
25
25
26
26
import static org .assertj .core .api .Assertions .assertThat ;
27
+ import static org .springframework .http .MediaType .*;
27
28
28
29
/**
29
30
* @author Greg Turnquist
33
34
@ AutoConfigureWebTestClient // <2>
34
35
public class LoadingWebSiteIntegrationTest {
35
36
36
- @ Autowired
37
- WebTestClient client ; // <3>
37
+ @ Autowired WebTestClient client ; // <3>
38
38
39
- @ Test // <4>
40
- void test () {
41
- client .get ().uri ("/" ).exchange ()
42
- .expectStatus ().isOk ()
43
- .expectHeader ().contentType (MediaType .TEXT_HTML )
44
- .expectBody (String .class ).consumeWith (exchangeResult -> {
45
- assertThat (exchangeResult .getResponseBody ()).contains ("<a href=\" /add" );
46
- });
47
- }
39
+ @ Test // <4>
40
+ void test () {
41
+ client .get ().uri ("/" ).exchange () //
42
+ .expectStatus ().isOk () //
43
+ .expectHeader ().contentType (TEXT_HTML ) //
44
+ .expectBody (String .class ) //
45
+ .consumeWith (exchangeResult -> {
46
+ assertThat (exchangeResult .getResponseBody ()).contains ("<a href=\" /add" );
47
+ });
48
+ }
48
49
}
49
50
// end::code[]
You can’t perform that action at this time.
0 commit comments