spring-cloud / spring-cloud/spring-cloud-gateway

Document Testing strategies

Open
#1,680 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.