//TODO this should return a list of what?
@Test(expected = RuntimeException.class)
  public void testAuthRequestIOException() throws IOException, MessageException, DiscoveryException, ConsumerException {
    DiscoveryInformation info = createMockInfo();
    HttpSession session = createMockSession(info, false, false, true);
    HttpServletRequest req = createMockRequest(session);
    HttpServletResponse resp = createMockResponse();
    AuthRequest authRequest = createMockAuthRequest();
    //TODO this should return a list of what?
    expect(mockManager.discover(eq("discover"))).andThrow(new IOException());
    expect(mockManager.associate(anyObject(List.class))).andReturn(info);
    expect(mockManager.authenticate(eq(info), eq("http://example.com:80/openid/openidcallback"))).andReturn(authRequest);
    replay(mockManager);
    consumer = new OpenIDConsumer("%origin%/openid/openidcallback", mockManager, "mockContextRoot", mockAuthority);
    assertFalse(consumer.authRequest("discover", req, resp));
  }
HttpServletResponse resp = createMockResponse();
AuthRequest authRequest = createMockAuthRequest();
//TODO this should return a list of what?
expect(mockManager.discover(eq("discover"))).andThrow(new IOException());
expect(mockManager.associate(anyObject(List.class))).andReturn(info);
@Test(expected = RuntimeException.class)
public void testAuthRequestIOException() throws IOException, MessageException, DiscoveryException, ConsumerException {
DiscoveryInformation info = createMockInfo();
HttpSession session = createMockSession(info, false, false, true);
HttpServletRequest req = createMockRequest(session);
HttpServletResponse resp = createMockResponse();
AuthRequest authRequest = createMockAuthRequest();
//TODO this should return a list of what?
expect(mockManager.discover(eq("discover"))).andThrow(new IOException());
expect(mockManager.associate(anyObject(List.class))).andReturn(info);
expect(mockManager.authenticate(eq(info), eq("http://example.com:80/openid/openidcallback"))).andReturn(authRequest);
replay(mockManager);
consumer = new OpenIDConsumer("%origin%/openid/openidcallback", mockManager, "mockContextRoot", mockAuthority);
assertFalse(consumer.authRequest("discover", req, resp));
}
@Test(expected = RuntimeException.class)
public void testAuthRequestIOException() throws IOException, MessageException, DiscoveryException, ConsumerException {
DiscoveryInformation info = createMockInfo();
HttpSession session = createMockSession(info, false, false, true);
HttpServletRequest req = createMockRequest(session);
HttpServletResponse resp = createMockResponse();
AuthRequest authRequest = createMockAuthRequest();
//TODO this should return a list of what?
expect(mockManager.discover(eq("discover"))).andThrow(new IOException());
expect(mockManager.associate(anyObject(List.class))).andReturn(info);
expect(mockManager.authenticate(eq(info), eq("http://example.com:80/openid/openidcallback"))).andReturn(authRequest);
replay(mockManager);
consumer = new OpenIDConsumer("%origin%/openid/openidcallback", mockManager, "mockContextRoot", mockAuthority);
assertFalse(consumer.authRequest("discover", req, resp));
}