Search in sources :

Example 1 with ExpirationPolicy

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);
}
Also used : ExpirationPolicy(org.apereo.cas.ticket.ExpirationPolicy) Test(org.junit.Test)

Example 2 with ExpirationPolicy

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);
}
Also used : ExpirationPolicy(org.apereo.cas.ticket.ExpirationPolicy) Test(org.junit.Test)

Example 3 with ExpirationPolicy

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);
}
Also used : ExpirationPolicy(org.apereo.cas.ticket.ExpirationPolicy) Test(org.junit.Test)

Example 4 with ExpirationPolicy

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);
}
Also used : ExpirationPolicy(org.apereo.cas.ticket.ExpirationPolicy) Test(org.junit.Test)

Example 5 with ExpirationPolicy

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);
}
Also used : ExpirationPolicy(org.apereo.cas.ticket.ExpirationPolicy) Test(org.junit.Test)

Aggregations

ExpirationPolicy (org.apereo.cas.ticket.ExpirationPolicy)10 Test (org.junit.Test)10