Update: As of Spring Boot 1.4.0, TestRestTemplate
does not extend RestTemplate
anymore but still provides the same API as RestTemplate
.
TestRestTemplate
extends provides the same API as the RestTemplate
RestTemplate
, so you can use that same API for sending requests. For example:
HttpHeaders headers = new HttpHeaders();
headers.add("your_header", "its_value");
template.exchange(base, HttpMethod.GET, new HttpEntity<>(headers), Page.class);