SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { new AuthInfo(req).setAuthType(handler.getName()).setSecurityToken(token); callChain(chain, req, resp); return;
SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { new AuthInfo(req).setAuthType(handler.getName()).setSecurityToken(token); callChain(chain, req, resp); return;
@Test public void testBinding() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); new AuthInfo(req).setSecurityToken(token).setAuthType("FakeAuth"); Injector injector = Guice.createInjector(new TestModule(req)); AuthInfo injected = injector.getInstance(AuthInfo.class); assertEquals(token, injected.getSecurityToken()); assertEquals("FakeAuth", injected.getAuthType()); }
@Test public void testBinding() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); new AuthInfo(req).setSecurityToken(token).setAuthType("FakeAuth"); Injector injector = Guice.createInjector(new TestModule(req)); AuthInfo injected = injector.getInstance(AuthInfo.class); assertEquals(token, injected.getSecurityToken()); assertEquals("FakeAuth", injected.getAuthType()); }
@Test public void testToken() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); AuthInfo info = new AuthInfo(req).setSecurityToken(token); assertEquals(token, info.getSecurityToken()); // This should work when creating a new AuthInfo from the same request assertEquals(token, new AuthInfo(req).getSecurityToken()); }
@Test public void testToken() throws Exception { HttpServletRequest req = new FakeHttpServletRequest(); SecurityToken token = new FakeGadgetToken(); AuthInfo info = new AuthInfo(req).setSecurityToken(token); assertEquals(token, info.getSecurityToken()); // This should work when creating a new AuthInfo from the same request assertEquals(token, new AuthInfo(req).getSecurityToken()); }