use of com.iplanet.dpro.session.share.SessionInfo in project OpenAM by OpenRock.
the class StatelessJWTCacheTest method shouldClearCache.
@Test
public void shouldClearCache() {
// Given
given(mockConfig.getJWTCacheSize()).willReturn(1);
cache = new StatelessJWTCache(mockConfig, mockListeners);
SessionInfo mockSessionInfo = mock(SessionInfo.class);
cache.cache(mockSessionInfo, "badger");
// When
cache.clear();
// Then
assertThat(cache.contains(mockSessionInfo)).isFalse();
}
use of com.iplanet.dpro.session.share.SessionInfo in project OpenAM by OpenRock.
the class StatelessJWTCacheTest method shouldCacheSessionInfoWithJWT.
@Test
public void shouldCacheSessionInfoWithJWT() {
// Given
given(mockConfig.getJWTCacheSize()).willReturn(1);
cache = new StatelessJWTCache(mockConfig, mockListeners);
String jwt = "badger";
SessionInfo mockInfo = mock(SessionInfo.class);
// When
cache.cache(mockInfo, jwt);
// Then
assertThat(cache.getSessionInfo(jwt)).isEqualTo(mockInfo);
}
Aggregations