use of com.iplanet.dpro.session.TokenRestriction in project OpenAM by OpenRock.
the class JSONSerialisationTest method tokenRestrictionDeserialisationWithTypeWorks.
@Test
public void tokenRestrictionDeserialisationWithTypeWorks() throws Exception {
InternalSession is = serialization.deserialise(getJSON("/json/basic-session-with-restriction.json"), InternalSession.class);
assertThat(is).isNotNull();
TokenRestriction restriction = is.getRestrictionForToken(new SessionID("AQIC5wM2LY4SfcyTLz6VjQ7nkFeDcEh8K5dXkIE" + "NpXlpg28.*AAJTSQACMDIAAlMxAAIwMQACU0sAEzc5ODIzMDM5MzQyNzU2MTg1NDQ.*"));
assertThat(restriction).isNotNull().isInstanceOf(DNOrIPAddressListTokenRestriction.class);
assertThat(restriction.toString().equals("Fzy2GsI/O1TsXhvlVuqjqIuTG2k="));
assertThat(is.getSessionHandle()).isNotNull().isEqualTo("shandle:weasel");
}
Aggregations