}
private static void assertResource(URI baseUri, HttpClient client, String path, String contents)
{
HttpUriBuilder uriBuilder = uriBuilderFrom(baseUri);
StringResponseHandler.StringResponse data = client.execute(prepareGet().setUri(uriBuilder.appendPath(path).build()).build(), createStringResponseHandler());
assertEquals(data.getStatusCode(), HttpStatus.OK.code());
MediaType contentType = MediaType.parse(data.getHeader(HttpHeaders.CONTENT_TYPE));
assertTrue(PLAIN_TEXT_UTF_8.is(contentType), "Expected text/plain but got " + contentType);
assertEquals(data.getBody().trim(), contents);
}