Skip to content

Allow for easier setting of request/url parameters with TestRestClient #36532

@mdeinum

Description

@mdeinum

We have some OpenAPI specs from external parties we need to use and connect to. Those specs specify, for GET requests at least, request parameters to be supplied to do some filtering. Currently there is no, easy, way to add those to the request.

We now need to manually construct the URL with placeholders for the request parameters and supply them as variables within the uri method.

restTestClient.get().uri("http://example.com/?foo={bar}", Map.of("bar", "baz").exchangeSuccesfully();

It would be a nice extension to be able to do something with param/params akin the header/headers functionality.

restTestClient.get().uri("http://example.com/).params(Map.of("bar", "baz")).exchangeSuccesfully();

or

restTestClient.get().uri("http://example.com/).param("bar", "baz").exchangeSuccesfully();

This would make it easier to reuse static variables for URLs (as generated with OpenAPI generator) and to add the parameters to the URL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions