spring-cloud / spring-cloud/spring-cloud-gateway
Document Testing strategies
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
Currently, the guide https://spring.io/guides/gs/gateway/#_writing_tests suggest to use "WireMock from Spring Cloud Contract in order stand up a server".
Unit tests of the people using this library to make gateways would be more performant, easier to write and more stable if they didn't make real tcp connections to do http requests to a mock server.
Describe the solution you'd like
I would like to be able to run unit tests without tcp connections. Ideally, something like spring-boot's @RestClientTest/MockRestServiceServer for resttemplate.
Describe alternatives you've considered
Make a clear statement in the docs explaining if this kind of test is supported or not. If not supported, explain why it is not supported.
Thanks for all the work, using wiremock server is already providing a lot of value !
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Spring Cloud Gateway guide's “Writing Tests” section and the existing WireMock-based testing guidance. Compare the requested no-TCP approach with Spring Boot's @RestClientTest and MockRestServiceServer, then determine whether support exists; done means either documenting a supported strategy or clearly explaining why it is not supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend-api-design, documentation, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100