Skip to content

Commit 53e227d

Browse files
committed
Add missing webflux docs test.
1 parent 79f5592 commit 53e227d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/src/test/java/com/mattbertolini/spring/web/bind/docs/webflux/WebFluxDocsJavaConfigIntegrationTest.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,34 @@
1616

1717
package com.mattbertolini.spring.web.bind.docs.webflux;
1818

19+
import org.junit.jupiter.api.BeforeEach;
20+
import org.junit.jupiter.api.Test;
21+
import org.springframework.http.MediaType;
1922
import org.springframework.test.context.junit.jupiter.web.SpringJUnitWebConfig;
23+
import org.springframework.test.web.reactive.server.WebTestClient;
24+
import org.springframework.web.context.WebApplicationContext;
25+
26+
import static org.springframework.web.reactive.function.BodyInserters.fromFormData;
2027

2128
@SpringJUnitWebConfig(classes = {ExampleContext.class})
2229
class WebFluxDocsJavaConfigIntegrationTest {
30+
private WebTestClient webTestClient;
31+
32+
@BeforeEach
33+
void setUp(WebApplicationContext webApplicationContext) {
34+
webTestClient = WebTestClient.bindToApplicationContext(webApplicationContext).build();
35+
}
36+
37+
@Test
38+
void name() {
39+
webTestClient.post()
40+
.uri("/example/42?different_name=different_value")
41+
.accept(MediaType.TEXT_PLAIN)
42+
.contentType(MediaType.APPLICATION_FORM_URLENCODED)
43+
.body(fromFormData("form_data_", "form_value"))
44+
.header("Accept-Language", "en-US")
45+
.header("X-Custom-Header", "A_Header_Value")
46+
.cookie("cookie_value", "some_cookie_value")
47+
.exchange().expectStatus().isOk();
48+
}
2349
}

0 commit comments

Comments
 (0)