public void basicAuthTestPreemtiveTest() throws IOException, ExecutionException, TimeoutException, InterruptedException {
AsyncHttpClient client = getAsyncHttpClient(null);
try {
// send the request to the no-auth endpoint to be able to verify the auth header is
// really sent preemptively for the initial call.
Future<Response> f = client.prepareGet(getTargetUrlNoAuth())//
.setRealm((new Realm.RealmBuilder()).setScheme(AuthScheme.BASIC).setPrincipal(USER).setPassword(ADMIN).setUsePreemptiveAuth(true).build())//
.execute();
Response resp = f.get(3, TimeUnit.SECONDS);
assertNotNull(resp);