@Test
public void authenticated() throws Exception {

  stubFor(get(urlEqualTo("/foo")).willReturn(aResponse().withStatus(HttpStatus.SC_OK).withBody("bar")));
  try (HttpHandler handler = new HttpHandler(url, options.withUsername("user").withPassword("pass"))) {
    handler.get("foo");
  }
  verify(getRequestedFor(urlEqualTo("/foo")).withBasicAuth(new BasicCredentials("user", "pass")));
}