use of com.zimbra.cs.account.ZimbraAuthToken in project zm-mailbox by Zimbra.
the class TestCookieReuse method testTokenExpiredTokenDeregistration.
/**
* test token being deregistered after it is expired
* @throws Exception
*/
@Test
public void testTokenExpiredTokenDeregistration() throws Exception {
Account a = TestUtil.getAccount(USER_NAME);
ZimbraAuthToken at = new ZimbraAuthToken(a, System.currentTimeMillis() - 1000);
ZimbraAuthToken at2 = new ZimbraAuthToken(a, System.currentTimeMillis() + 10000);
Assert.assertFalse("First token should not be registered", at.isRegistered());
Assert.assertTrue("Second token should be registered", at2.isRegistered());
}
use of com.zimbra.cs.account.ZimbraAuthToken in project zm-mailbox by Zimbra.
the class TestCookieReuse method testClearCookies.
/**
* Verify that when zimbraForceClearCookies is set to TRUE authtokens get deregistered
* @throws Exception
*/
@Test
public void testClearCookies() throws Exception {
Account a = TestUtil.getAccount(USER_NAME);
a.setForceClearCookies(true);
ZimbraAuthToken at = new ZimbraAuthToken(a);
Assert.assertTrue("token should be registered", at.isRegistered());
at.deRegister();
Assert.assertFalse("token should not be registered", at.isRegistered());
}
Aggregations