use of org.apereo.cas.pac4j.BrowserWebStorageSessionStore in project cas by apereo.
the class BrowserWebStorageSessionStoreTests method verifyOperation.
@Test
public void verifyOperation() {
val store = new BrowserWebStorageSessionStore(webflowCipherExecutor);
val request = new MockHttpServletRequest();
val ctx = new JEEContext(request, new MockHttpServletResponse());
store.set(ctx, "key1", "value1");
store.set(ctx, "key2", List.of("HelloWorld"));
store.set(ctx, "key3", 1234567);
store.set(ctx, "dummy", new Dummy());
var session = store.getTrackableSession(ctx);
assertTrue(session.isPresent());
store.renewSession(ctx);
val trackableSession = (BrowserSessionStorage) session.get();
store.buildFromTrackableSession(ctx, trackableSession.getPayload());
assertTrue(store.get(ctx, "key1").isPresent());
assertTrue(store.get(ctx, "key2").isPresent());
assertTrue(store.get(ctx, "key3").isPresent());
assertTrue(store.get(ctx, "dummy").isPresent());
}
Aggregations