final HttpHeaders headers = new HttpHeadersBuilder().acceptJSON().acceptUTF8().build();
final HttpEntity<String> entity = new HttpEntity<String>( headers );
try
{
final ResponseEntity<String> response = template.exchange( "http://localhost:8080/echo/time", HttpMethod.GET, entity, String.class );
assertThat( response, is( notNullValue() ) );
assertThat( response.getStatusCode(), is( notNullValue() ) );
assertThat( response.getStatusCode(), is( equalTo( HttpStatus.OK ) ) );
assertThat( response.hasBody(), is( equalTo( true ) ) );
System.out.println( response.getBody() );