question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document how to use Spring REST Docs with the WebTestClient with Spring-Boot

See original GitHub issue

Where in the documentation I could present a example of using it with WebTestClient + Spring-Boot. e.g.

@WebFluxTest
@AutoConfigureRestDocs
class ControllerTests {

    private WebTestClient webClient;

    @BeforeEach
    void setUp(
            @Autowired ApplicationContext context,
            @Autowired WebTestClientRestDocumentationConfigurer configurer) {

        webClient = WebTestClient
                .bindToApplicationContext(context)
                .configureClient()
                .filter(configurer)
                .entityExchangeResultConsumer(document("{class-name}/{method-name}"))
                .build();
    }
}

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
wilkinsonacommented, Aug 18, 2021

I wouldn’t mind at all. Thanks for the offer.

While the issue I just opened is targeted at 2.4.x, a PR based off main would still be useful. If you do that this is where the new documentation should be added. Alternatively, if you’d prefer to base your PR off the 2.4.x branch, the new documentation should go here.

0reactions
brnetocommented, Aug 18, 2021

@wilkinsona That’s a very good idea. It’s could help others like me! And thank you so much for your example above! That’s amazing!

If you want I can create a PR for your example above. Would you mind?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spring REST Docs
Spring REST Docs helps you to document RESTful services. It combines hand-written documentation written with Asciidoctor and auto-generated snippets produced ...
Read more >
Introduction to Spring REST Docs - Baeldung
This article introduces Spring REST Docs, a test-driven mechanism to generate documentation for RESTful services that is both accurate and ...
Read more >
Documenting Spring Boot Restful Services (Spring ... - LinkedIn
Spring REST docs uses your tests to generate documentation. What tests? In our case, unit tests for your controllers using Spring MockMvc ...
Read more >
Spring REST Docs - Test driven documentation of REST API
How to document your Spring Boot REST APIs using Swagger with SpringFox? It is a powerful tool, which can be useful especially when...
Read more >
Document your API with Spring REST Docs - Igorski
Currently REST Docs can be used in tests that use Spring MVC's test framework, Spring WebFlux's WebTestClient or REST Assured 3.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found