Methods Summary |
---|
protected void | setUp()
session = new HashMap();
Map params = new HashMap();
Map ctxMap = new HashMap();
ctxMap.put(ActionContext.SESSION, session);
ctxMap.put(ActionContext.PARAMETERS, params);
ActionContext ctx = new ActionContext(ctxMap);
ActionContext.setContext(ctx);
|
protected void | tearDown()
ActionContext.setContext(null);
|
public void | testSetToken()
String token = TokenHelper.setToken();
assertEquals(token, session.get(TokenHelper.DEFAULT_TOKEN_NAME));
|
public void | testSetTokenWithName()
String tokenName = "myTestToken";
String token = TokenHelper.setToken(tokenName);
assertEquals(token, session.get(tokenName));
|
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());
|