resolverDirectHTTP.engineSetProperty("http.basic.username", serverUsername);
resolverDirectHTTP.engineSetProperty("http.basic.password", "wrongPassword");
ResourceResolverContext context =
new ResourceResolverContext(uri, url, true);
try {
resolverDirectHTTP.engineResolveURI(context);
Assert.fail("Expected ResourceResolverException");
} catch (ResourceResolverException e) {
Assert.assertEquals("Server returned HTTP response code: 401 for URL: " + url, e.getMessage());
}
}