use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class OAuthAccessTokenExpirationPolicyTests method verifySerializeAnOAuthAccessTokenExpirationPolicyToJson.
@Test
public void verifySerializeAnOAuthAccessTokenExpirationPolicyToJson() throws IOException {
final OAuthAccessTokenExpirationPolicy policyWritten = new OAuthAccessTokenExpirationPolicy(1234L, 5678L);
MAPPER.writeValue(JSON_FILE, policyWritten);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, OAuthAccessTokenExpirationPolicy.class);
assertEquals(policyWritten, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class OAuthRefreshTokenExpirationPolicyTests method verifySerializeAnOAuthRefreshTokenExpirationPolicyToJson.
@Test
public void verifySerializeAnOAuthRefreshTokenExpirationPolicyToJson() throws IOException {
final OAuthRefreshTokenExpirationPolicy policyWritten = new OAuthRefreshTokenExpirationPolicy(1234L);
MAPPER.writeValue(JSON_FILE, policyWritten);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, OAuthRefreshTokenExpirationPolicy.class);
assertEquals(policyWritten, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class RememberMeDelegatingExpirationPolicyTests method verifySerializeATimeoutExpirationPolicyToJson.
@Test
public void verifySerializeATimeoutExpirationPolicyToJson() throws IOException {
MAPPER.writeValue(JSON_FILE, p);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, RememberMeDelegatingExpirationPolicy.class);
assertEquals(p, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class TicketGrantingTicketExpirationPolicyTests method verifySerializeAnExpirationPolicyToJson.
@Test
public void verifySerializeAnExpirationPolicyToJson() throws IOException {
MAPPER.writeValue(JSON_FILE, expirationPolicy);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, TicketGrantingTicketExpirationPolicy.class);
assertEquals(expirationPolicy, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class NeverExpiresExpirationPolicyTests method verifySerializeANeverExpiresExpirationPolicyToJson.
@Test
public void verifySerializeANeverExpiresExpirationPolicyToJson() throws IOException {
final NeverExpiresExpirationPolicy policyWritten = new NeverExpiresExpirationPolicy();
MAPPER.writeValue(JSON_FILE, policyWritten);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, NeverExpiresExpirationPolicy.class);
assertEquals(policyWritten, policyRead);
}
Aggregations