Class RootUriRequestExpectationManager

java.lang.Object
org.springframework.boot.restclient.test.RootUriRequestExpectationManager
All Implemented Interfaces:
RequestExpectationManager

@Deprecated(since="4.2.0", forRemoval=true) public class RootUriRequestExpectationManager extends Object implements RequestExpectationManager
Deprecated, for removal: This API element is subject to removal in a future version.
since 4.2.0 for removal in 4.4.0 with no replacement
RequestExpectationManager that strips the specified root URI from the request before verification. Can be used to simply test declarations when all REST calls start the same way. For example:
RestTemplate restTemplate = new RestTemplateBuilder().baseUri("https://example.com").build();
MockRestServiceServer server = RootUriRequestExpectationManager.bindTo(restTemplate);
server.expect(requestTo("/hello")).andRespond(withSuccess());
restTemplate.getForEntity("/hello", String.class);
Since:
4.0.0
Author:
Phillip Webb
See Also: