Closed eiswind closed 11 months ago
I just stumbled accross this when moving a test from MockMvc to MockMvcWebTestClient.
As far as I could see the AutoConfigureRestDocs for WebTestClient only works in a reactive web app. It's not a big deal, as I could workaround like
@ExtendWith(RestDocumentationExtension.class) @WebMvcTest(CustomerApiController.class) class CustomerApiControllerTest { private WebTestClient client; @Autowired MockMvc mockMvc; @BeforeEach public void setUp(RestDocumentationContextProvider restDocumentation) { this.client = MockMvcWebTestClient.bindTo(mockMvc).baseUrl("http://localhost") .filter(documentationConfiguration(restDocumentation)) .build(); }
Can you imagine providing something like this with the AutoConfiguration?
Duplicates https://github.com/spring-projects/spring-restdocs/issues/691 and https://github.com/spring-projects/spring-boot/issues/35348.
@wilkinsona Thanks for pointing me there. As for my use case this workaround seems to do what I need.
I just stumbled accross this when moving a test from MockMvc to MockMvcWebTestClient.
As far as I could see the AutoConfigureRestDocs for WebTestClient only works in a reactive web app. It's not a big deal, as I could workaround like
Can you imagine providing something like this with the AutoConfiguration?