Example #1
0
 public void testValidToken() {
   String tokenName = "validTokenTest";
   String token = TokenHelper.setToken(tokenName);
   assertEquals(token, session.get(tokenName));
   ActionContext.getContext()
       .getParameters()
       .put(TokenHelper.TOKEN_NAME_FIELD, new String[] {tokenName});
   ActionContext.getContext().getParameters().put(tokenName, new String[] {token});
   assertTrue(TokenHelper.validToken());
 }
Example #2
0
 public void testSetTokenWithName() {
   String tokenName = "myTestToken";
   String token = TokenHelper.setToken(tokenName);
   assertEquals(token, session.get(tokenName));
 }
Example #3
0
 public void testSetToken() {
   String token = TokenHelper.setToken();
   assertEquals(token, session.get(TokenHelper.DEFAULT_TOKEN_NAME));
 }