use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class ThrottledUseAndTimeoutExpirationPolicyTests method verifySerializeATimeoutExpirationPolicyToJson.
@Test
public void verifySerializeATimeoutExpirationPolicyToJson() throws IOException {
MAPPER.writeValue(JSON_FILE, expirationPolicy);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, ThrottledUseAndTimeoutExpirationPolicy.class);
assertEquals(expirationPolicy, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class TimeoutExpirationPolicyTests method verifySerializeATimeoutExpirationPolicyToJson.
@Test
public void verifySerializeATimeoutExpirationPolicyToJson() throws IOException {
MAPPER.writeValue(JSON_FILE, expirationPolicy);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, TimeoutExpirationPolicy.class);
assertEquals(expirationPolicy, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class AlwaysExpiresExpirationPolicyTests method verifySerializeAnAlwaysExpiresExpirationPolicyToJson.
@Test
public void verifySerializeAnAlwaysExpiresExpirationPolicyToJson() throws IOException {
final AlwaysExpiresExpirationPolicy policyWritten = new AlwaysExpiresExpirationPolicy();
MAPPER.writeValue(JSON_FILE, policyWritten);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, AlwaysExpiresExpirationPolicy.class);
assertEquals(policyWritten, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class HardTimeoutExpirationPolicyTests method verifySerializeANeverExpiresExpirationPolicyToJson.
@Test
public void verifySerializeANeverExpiresExpirationPolicyToJson() throws IOException {
final HardTimeoutExpirationPolicy policyWritten = new HardTimeoutExpirationPolicy();
MAPPER.writeValue(JSON_FILE, policyWritten);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, HardTimeoutExpirationPolicy.class);
assertEquals(policyWritten, policyRead);
}
use of org.apereo.cas.ticket.ExpirationPolicy in project cas by apereo.
the class MultiTimeUseOrTimeoutExpirationPolicyTests method verifySerializeATimeoutExpirationPolicyToJson.
@Test
public void verifySerializeATimeoutExpirationPolicyToJson() throws IOException {
MAPPER.writeValue(JSON_FILE, expirationPolicy);
final ExpirationPolicy policyRead = MAPPER.readValue(JSON_FILE, MultiTimeUseOrTimeoutExpirationPolicy.class);
assertEquals(expirationPolicy, policyRead);
}
Aggregations