use of org.xdi.oxauth.model.ldap.TokenLdap in project oxAuth by GluuFederation.
the class GrantServiceTest method createTestToken.
private TokenLdap createTestToken() {
final String id = GrantService.generateGrantId();
final String grantId = GrantService.generateGrantId();
final String dn = grantService.buildDn(id, grantId, m_clientId);
final TokenLdap t = new TokenLdap();
t.setId(id);
t.setDn(dn);
t.setGrantId(grantId);
t.setClientId(m_clientId);
t.setTokenCode(TEST_TOKEN_CODE);
t.setTokenType(TokenType.ACCESS_TOKEN.getValue());
t.setCreationDate(new Date());
t.setExpirationDate(new Date());
return t;
}
use of org.xdi.oxauth.model.ldap.TokenLdap in project oxAuth by GluuFederation.
the class GrantServiceTest method testCleanUp.
@Test(dependsOnMethods = "createTestToken")
public void testCleanUp() {
// clean up must remove just created token
grantService.cleanUp();
// because expiration is set to new Date()
final TokenLdap t = grantService.getGrantsByCode(TEST_TOKEN_CODE);
Assert.assertTrue(t == null);
}
Aggregations