Search in sources :

Example 6 with CoreWrapper

use of org.forgerock.openam.core.CoreWrapper in project OpenAM by OpenRock.

the class SessionConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    coreWrapper = mock(CoreWrapper.class);
    timeService = mock(TimeService.class);
    condition = new SessionCondition(debug, coreWrapper, timeService);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) TimeService(org.forgerock.util.time.TimeService) SessionCondition(org.forgerock.openam.entitlement.conditions.environment.SessionCondition) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 7 with CoreWrapper

use of org.forgerock.openam.core.CoreWrapper in project OpenAM by OpenRock.

the class AuthenticateToServiceConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    coreWrapper = mock(CoreWrapper.class);
    entitlementCoreWrapper = mock(EntitlementCoreWrapper.class);
    condition = new AuthenticateToServiceCondition(debug, coreWrapper, entitlementCoreWrapper);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 8 with CoreWrapper

use of org.forgerock.openam.core.CoreWrapper in project OpenAM by OpenRock.

the class OAuth2AuditOAuth2TokenContextProvider method getUserIdFromUsernameAndRealm.

protected String getUserIdFromUsernameAndRealm(String username, String realm) {
    if (username == null || realm == null) {
        return null;
    }
    CoreWrapper cw = new CoreWrapper();
    AMIdentity identity = cw.getIdentity(username, realm);
    if (identity != null) {
        return identity.getUniversalId();
    }
    return null;
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) AMIdentity(com.sun.identity.idm.AMIdentity)

Example 9 with CoreWrapper

use of org.forgerock.openam.core.CoreWrapper in project OpenAM by OpenRock.

the class ResourceSetServiceTest method setup.

@BeforeMethod
public void setup() throws Exception {
    ResourceSetStoreFactory resourceSetStoreFactory = mock(ResourceSetStoreFactory.class);
    resourceSetStore = mock(ResourceSetStore.class);
    policyService = mock(UmaPolicyService.class);
    coreWrapper = mock(CoreWrapper.class);
    UmaProviderSettingsFactory umaProviderSettingsFactory = mock(UmaProviderSettingsFactory.class);
    umaProviderSettings = mock(UmaProviderSettings.class);
    service = new ResourceSetService(resourceSetStoreFactory, policyService, coreWrapper, umaProviderSettingsFactory);
    given(resourceSetStoreFactory.create("REALM")).willReturn(resourceSetStore);
    given(umaProviderSettingsFactory.get("REALM")).willReturn(umaProviderSettings);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) UmaPolicyService(org.forgerock.openam.uma.UmaPolicyService) UmaProviderSettings(org.forgerock.openam.uma.UmaProviderSettings) ResourceSetStore(org.forgerock.oauth2.resources.ResourceSetStore) UmaProviderSettingsFactory(org.forgerock.openam.uma.UmaProviderSettingsFactory) ResourceSetStoreFactory(org.forgerock.openam.oauth2.resources.ResourceSetStoreFactory) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

CoreWrapper (org.forgerock.openam.core.CoreWrapper)9 BeforeMethod (org.testng.annotations.BeforeMethod)8 Debug (com.sun.identity.shared.debug.Debug)4 SSOToken (com.iplanet.sso.SSOToken)2 SSOException (com.iplanet.sso.SSOException)1 SSOTokenManager (com.iplanet.sso.SSOTokenManager)1 AMIdentity (com.sun.identity.idm.AMIdentity)1 SMSException (com.sun.identity.sm.SMSException)1 HttpServletRequest (javax.servlet.http.HttpServletRequest)1 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 ResourceApiVersionBehaviourManager (org.forgerock.http.routing.ResourceApiVersionBehaviourManager)1 SessionContext (org.forgerock.http.session.SessionContext)1 ServletJwtSessionModule (org.forgerock.jaspi.modules.session.jwt.ServletJwtSessionModule)1 CollectionResourceProvider (org.forgerock.json.resource.CollectionResourceProvider)1 SingletonResourceProvider (org.forgerock.json.resource.SingletonResourceProvider)1 HttpContext (org.forgerock.json.resource.http.HttpContext)1 ResourceSetStore (org.forgerock.oauth2.resources.ResourceSetStore)1 AbstractHttpAccessAuditFilter (org.forgerock.openam.audit.AbstractHttpAccessAuditFilter)1 AuditEventFactory (org.forgerock.openam.audit.AuditEventFactory)1 AuditEventPublisher (org.forgerock.openam.audit.AuditEventPublisher)1