Protocol.getProtocol("http"));
client.getState().setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials("username","password"));
FakeHttpMethod httpget = new FakeHttpMethod("/");
try {
client.executeMethod(httpget);
} finally {
httpget.releaseConnection();
}
assertNotNull(httpget.getStatusLine());
assertEquals(HttpStatus.SC_OK, httpget.getStatusLine().getStatusCode());
Map table = AuthChallengeParser.extractParams(
httpget.getRequestHeader("Authorization").getValue());
assertEquals("username", table.get("username"));
assertEquals("realm1", table.get("realm"));
assertEquals("/", table.get("uri"));
assertEquals("321CBA", table.get("nonce"));
assertEquals("7f5948eefa115296e9279225041527b3", table.get("response"));