use of org.forgerock.openam.sts.token.ThreadLocalAMTokenCache in project OpenAM by OpenRock.
the class TokenDelegationHandlersProviderTest method testDefaultDelegationHandler.
@Test
public void testDefaultDelegationHandler() throws UnsupportedEncodingException {
Logger mockLogger = mock(Logger.class);
ThreadLocalAMTokenCache mockTokenCache = mock(ThreadLocalAMTokenCache.class);
SoapSTSInstanceConfig instanceConfig = createInstanceConfig(DELEGATION_VALIDATORS_SPECIFIED, !CUSTOM_DELEGATION_HANDLER);
assertTrue(new TokenDelegationHandlersProvider(instanceConfig, mockTokenCache, mockLogger).get().get(0) instanceof DefaultTokenDelegationHandler);
}
use of org.forgerock.openam.sts.token.ThreadLocalAMTokenCache in project OpenAM by OpenRock.
the class TokenDelegationHandlersProviderTest method testWrappedCustomDelegationHandler.
@Test
public void testWrappedCustomDelegationHandler() throws UnsupportedEncodingException {
Logger mockLogger = mock(Logger.class);
ThreadLocalAMTokenCache mockTokenCache = mock(ThreadLocalAMTokenCache.class);
SoapSTSInstanceConfig instanceConfig = createInstanceConfig(!DELEGATION_VALIDATORS_SPECIFIED, CUSTOM_DELEGATION_HANDLER);
assertTrue(new TokenDelegationHandlersProvider(instanceConfig, mockTokenCache, mockLogger).get().get(0) instanceof CustomDelegationHandlerWrapper);
}
use of org.forgerock.openam.sts.token.ThreadLocalAMTokenCache in project OpenAM by OpenRock.
the class TokenDelegationHandlersProviderTest method testNoDelegationSupported.
@Test
public void testNoDelegationSupported() throws UnsupportedEncodingException {
Logger mockLogger = mock(Logger.class);
ThreadLocalAMTokenCache mockTokenCache = mock(ThreadLocalAMTokenCache.class);
SoapSTSInstanceConfig instanceConfig = createInstanceConfig(!DELEGATION_VALIDATORS_SPECIFIED, !CUSTOM_DELEGATION_HANDLER);
assertTrue(new TokenDelegationHandlersProvider(instanceConfig, mockTokenCache, mockLogger).get().isEmpty());
}
Aggregations