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