예제 #1
0
  public void testGetTokenDoesNotNpe() {
    String token = TokenHelper.getToken(null);
    assertTrue(token == null);

    String token2 = TokenHelper.getToken("");
    assertTrue(token2 == null);
  }
예제 #2
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());
 }
예제 #3
0
 public void testSetTokenWithName() {
   String tokenName = "myTestToken";
   String token = TokenHelper.setToken(tokenName);
   assertEquals(token, session.get(tokenName));
 }
예제 #4
0
 public void testSetToken() {
   String token = TokenHelper.setToken();
   assertEquals(token, session.get(TokenHelper.DEFAULT_TOKEN_NAME));
 }