Skip to content

TestRestTemplate equivalent class for RestClient #40452

Closed as not planned
Closed as not planned
@ebussieres

Description

@ebussieres

Spring introduced the RestClient interface (https://docs.spring.io/spring-framework/reference/integration/rest-clients.html) recently. I was wondering if there's any plan to add an equivalent class for TestRestTemplate to make some rest call in our tests.

Actual testing looks like this. It would be nice to have a TestRestClient class to make some fluent http call

@SpringBootTest(webEnvironment = RANDOM_PORT)
class ApplicationTests {
  
  @Autowired
  private TestRestTemplate testRestTemplate;

  @Test
  void contextLoads() {
    //Make some call using testRestTemplate and make some assertions
  }
}

Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fixstatus: duplicateA duplicate of another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions