Skip to content

Introduce an alternative to WebTestClient based on RestClient #31275

Closed as not planned
@EvaristeGalois11

Description

@EvaristeGalois11

Hi, I searched the other issues discussing the introduction of RestClient but i couldn't find anything regarding this topic. I apologize if it's been already discussed somewhere.

Currently the only way to call a controller in a RANDOM_PORT environment is through TestRestTemplate (which is a spring boot addition) or with a RestClient instance built for the task. Both of this approaches aren't very nice, given that one must extract from the response object all the parts and then manually asserting on them. WebClientTest on the other hand has a really nice api with the assertions baked in, but it needs all the reactive stuff to be brought in.

A third party alternative is REST Assured which works quite well and has a very nice api, but it would be better i think to not have to rely on some external libraries for this type of thing.

Could it be possible to add a very similar api to WebTestClient (RestTestClient?) but without the reactive side of it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: testIssues in the test modulein: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions