@Test
public void simplePost() throws Exception {

  stubFor(post(urlEqualTo("/foo")).willReturn(aResponse().withStatus(HttpStatus.SC_OK).withBody("bar")));
  try (HttpHandler handler = new HttpHandler(url, options)) {
    HttpEntity entity = EntityBuilder.create().setText("baz").build();
    HttpResponse response = handler.post("foo", entity);
    try (Reader reader = new InputStreamReader(response.getEntity().getContent())) {
      assertThat(CharStreams.toString(reader), is("bar"));
    }
  }
  verify(postRequestedFor(urlEqualTo("/foo")).withRequestBody(equalTo("baz")));
}