spring-projects / spring-projects/spring-framework

Support HTTP Interface Clients in Test Framework

Open
#36,674 12 comments 0 reactions 1 assignee View on GitHub

@rstoyanchev is already working on this.

Since Jun 4, 2026.

in: web status: waiting-for-internal-feedback status: waiting-for-triage
Dominant language
Java
Stars
60.2k
Forks
38.8k
Avg merge
5d 2h
Merged PRs (30d)
27

Description

From: https://docs.spring.io/spring-framework/reference/integration/rest-clients.html#rest-http-service-client

[start quote]

On the server side, an @Controller class can implement the same interface to handle requests with @HttpExchange controller methods.

[end quote]

At the moment, there are WebTestClient and RestTestClient for REST Testing. However, it may be beneficial to use HTTP Interface clients for testing where WebTestClient and RestTestClient assertions are not needed.

At the moment, I see no way to instantiate HTTP Interface Clients and bind them to test Web Server in conjunction with SpringBootTest.WebEnvironment.RANDOM_PORT.

Would you be interested in providing any kind of support for using HTTP Interface Clients within Test Context?

At least consider providing HttpExchangeAdapter for WebTestClient and RestTestClient.

Thanks in advance.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.