public void testAuthChallengeStateMultipleOption() throws Exception {
final HttpRequest request = new BasicHttpRequest("GET", "/");
this.authState.setState(AuthProtocolState.CHALLENGED);
final LinkedList<AuthOption> authOptions = new LinkedList<AuthOption>();
final ContextAwareAuthScheme authScheme1 = Mockito.mock(ContextAwareAuthScheme.class);
Mockito.doThrow(new AuthenticationException()).when(authScheme1).authenticate(
Mockito.any(Credentials.class),
Mockito.any(HttpRequest.class),
Mockito.any(HttpContext.class));
final ContextAwareAuthScheme authScheme2 = Mockito.mock(ContextAwareAuthScheme.class);
Mockito.when(authScheme2.authenticate(
Mockito.any(Credentials.class),
Mockito.any(HttpRequest.class),
Mockito.any(HttpContext.class))).thenReturn(new BasicHeader(AUTH.WWW_AUTH_RESP, "stuff"));
authOptions.add(new AuthOption(authScheme1, this.credentials));
authOptions.add(new AuthOption(authScheme2, this.credentials));