@Test
  public void testAuthRequest() 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"))).andReturn(Lists.newArrayList());
    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
  public void testAuthRequest() 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();
   
    expect(mockManager.discover(eq("discover"))).andReturn(Lists.newArrayList());
    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 public void testauthrequest() 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(); expect(mockmanager.discover(eq("discover"))).andreturn(lists.newarraylist()); 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)); }