NTCredentials cred = new NTCredentials("username","password", "host",
"domain");
state.setCredentials(null, null, cred);
HttpMethod method = new SimpleHttpMethod(new Header("WWW-Authenticate", challenge));
method.addRequestHeader("Host", "host");
AuthScheme authscheme = new NTLMScheme(challenge);
assertTrue(authenticate(authscheme, method, null, state));
assertTrue(null != method.getRequestHeader("Authorization"));
assertEquals(expected,
method.getRequestHeader("Authorization").getValue());
}