Search in sources :

Example 41 with SessionInfo

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();
}
Also used : SessionInfo(com.iplanet.dpro.session.share.SessionInfo) Test(org.testng.annotations.Test)

Example 42 with SessionInfo

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);
}
Also used : SessionInfo(com.iplanet.dpro.session.share.SessionInfo) BDDMockito.anyString(org.mockito.BDDMockito.anyString) Test(org.testng.annotations.Test)

Aggregations

SessionInfo (com.iplanet.dpro.session.share.SessionInfo)42 Test (org.testng.annotations.Test)18 SessionException (com.iplanet.dpro.session.SessionException)8 SessionID (com.iplanet.dpro.session.SessionID)6 SessionResponse (com.iplanet.dpro.session.share.SessionResponse)5 SessionRequest (com.iplanet.dpro.session.share.SessionRequest)4 InternalSession (com.iplanet.dpro.session.service.InternalSession)3 Session (com.iplanet.dpro.session.Session)2 TokenRestriction (com.iplanet.dpro.session.TokenRestriction)2 SSOException (com.iplanet.sso.SSOException)2 URL (java.net.URL)2 KeyPair (java.security.KeyPair)2 HashMap (java.util.HashMap)2 SigningManager (org.forgerock.json.jose.jws.SigningManager)2 StatelessSession (org.forgerock.openam.sso.providers.stateless.StatelessSession)2 ThreadPoolException (com.iplanet.am.util.ThreadPoolException)1 SessionTimedOutException (com.iplanet.dpro.session.SessionTimedOutException)1 SessionOperations (com.iplanet.dpro.session.operations.SessionOperations)1 Action (com.iplanet.services.naming.ServiceListeners.Action)1 SSOToken (com.iplanet.sso.SSOToken)1