@Test
public void testBasicAuth() throws Exception {

	final boolean[] handled = {false};
	startWithHandler(new AbstractHandler() {
		@Override
		public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
			baseRequest.setHandled(true);
			assertEquals("Basic dXNlcjpwYXNz", request.getHeader("Authorization"));
			assertThat(request.getQueryString()).isEqualTo("bar=baz");
			handled[0] = true;
		}
	});
	assertEquals(Integer.valueOf(200), httpClient.send(HttpRequestBuilder.<Integer>forUrl("http://user:pass@localhost:" + getPort() + "/foo?bar=baz")
			.successHandler(new StatusCodeResponseHandler()).build()));
	assertTrue(handled[0]);
}