Search in sources :

Example 1 with CoreWrapper

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

the class AuthLevelConditionTest method setUp.

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

Example 2 with CoreWrapper

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

the class RestRouterIT method setupMocks.

@BeforeMethod
public void setupMocks() {
    MockitoAnnotations.initMocks(this);
    configResource = mock(SingletonResourceProvider.class);
    usersResource = mock(CollectionResourceProvider.class);
    internalResource = mock(CollectionResourceProvider.class);
    dashboardResource = spy(new DashboardResource());
    authenticateResource = spy(new AuthenticateResource());
    httpAccessAuditFilter = spy(new AbstractHttpAccessAuditFilter(AUTHENTICATION, mock(AuditEventPublisher.class), mock(AuditEventFactory.class)) {

        @Override
        protected String getRealm(Context context) {
            return null;
        }
    });
    auditEventPublisher = mock(AuditEventPublisher.class);
    auditServiceProvider = mock(AuditServiceProvider.class);
    versionBehaviourManager = mock(ResourceApiVersionBehaviourManager.class);
    ssoTokenManager = mock(SSOTokenManager.class);
    authUtilsWrapper = mock(AuthUtilsWrapper.class);
    coreWrapper = mock(CoreWrapper.class);
    SSOToken adminToken = mock(SSOToken.class);
    given(coreWrapper.getAdminToken()).willReturn(adminToken);
    given(coreWrapper.isValidFQDN(anyString())).willReturn(true);
    realmValidator = mock(RestRealmValidator.class);
}
Also used : RootContext(org.forgerock.services.context.RootContext) RequestAuditContext(org.forgerock.services.context.RequestAuditContext) HttpContext(org.forgerock.json.resource.http.HttpContext) SessionContext(org.forgerock.http.session.SessionContext) SSOTokenContext(org.forgerock.openam.rest.resource.SSOTokenContext) AttributesContext(org.forgerock.services.context.AttributesContext) SecurityContext(org.forgerock.services.context.SecurityContext) Context(org.forgerock.services.context.Context) SSOTokenManager(com.iplanet.sso.SSOTokenManager) CoreWrapper(org.forgerock.openam.core.CoreWrapper) AuditServiceProvider(org.forgerock.openam.audit.AuditServiceProvider) SSOToken(com.iplanet.sso.SSOToken) SingletonResourceProvider(org.forgerock.json.resource.SingletonResourceProvider) AuditEventPublisher(org.forgerock.openam.audit.AuditEventPublisher) CollectionResourceProvider(org.forgerock.json.resource.CollectionResourceProvider) AuthUtilsWrapper(org.forgerock.openam.authentication.service.AuthUtilsWrapper) AuditEventFactory(org.forgerock.openam.audit.AuditEventFactory) ResourceApiVersionBehaviourManager(org.forgerock.http.routing.ResourceApiVersionBehaviourManager) RestRealmValidator(org.forgerock.openam.rest.router.RestRealmValidator) AbstractHttpAccessAuditFilter(org.forgerock.openam.audit.AbstractHttpAccessAuditFilter) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 3 with CoreWrapper

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

the class AMIdentityMembershipConditionTest method setUp.

@BeforeMethod
public void setUp() {
    Debug debug = mock(Debug.class);
    coreWrapper = mock(CoreWrapper.class);
    condition = new AMIdentityMembershipCondition(debug, coreWrapper);
    adminToken = mock(SSOToken.class);
    given(coreWrapper.getAdminToken()).willReturn(adminToken);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) SSOToken(com.iplanet.sso.SSOToken) Debug(com.sun.identity.shared.debug.Debug) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 4 with CoreWrapper

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

the class PendingRequestsServiceTest method setup.

@SuppressWarnings("unchecked")
@BeforeMethod
public void setup() throws Exception {
    initMocks(this);
    UmaProviderSettingsFactory settingsFactory = mock(UmaProviderSettingsFactory.class);
    given(settingsFactory.get(anyString())).willReturn(settings);
    BaseURLProviderFactory baseUrlProviderFactory = mock(BaseURLProviderFactory.class);
    given(baseUrlProviderFactory.get(anyString())).willReturn(baseUrlProvider);
    CoreWrapper coreWrapper = mock(CoreWrapper.class);
    given(coreWrapper.getIdentity(RESOURCE_OWNER_ID, REALM)).willReturn(resourceOwnerIdentity);
    service = new PendingRequestsService(store, auditLogger, settingsFactory, emailService, pendingRequestEmailTemplate, policyService, baseUrlProviderFactory, coreWrapper);
}
Also used : CoreWrapper(org.forgerock.openam.core.CoreWrapper) BaseURLProviderFactory(org.forgerock.openam.services.baseurl.BaseURLProviderFactory) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 5 with CoreWrapper

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

the class PersistentCookieAuthModuleTest method setUp.

@BeforeMethod
public void setUp() {
    jwtSessionModule = mock(ServletJwtSessionModule.class);
    amKeyProvider = mock(AMKeyProvider.class);
    amLoginModuleBinder = mock(AMLoginModuleBinder.class);
    coreWrapper = mock(CoreWrapper.class);
    persistentCookieAuthModule = new PersistentCookieAuthModule(jwtSessionModule, amKeyProvider, coreWrapper) {

        @Override
        protected String getKeyAlias(String orgName) throws SSOException, SMSException {
            return "KEY_ALIAS";
        }
    };
    persistentCookieAuthModule.setAMLoginModule(amLoginModuleBinder);
    given(amKeyProvider.getPrivateKeyPass()).willReturn("PRIVATE_KEY_PASS");
    given(amKeyProvider.getKeystoreType()).willReturn("KEYSTORE_TYPE");
    given(amKeyProvider.getKeystoreFilePath()).willReturn("KEYSTORE_FILE_PATH");
    given(amKeyProvider.getKeystorePass()).willReturn("KEYSTORE_PASS".toCharArray());
    HttpServletRequest request = mock(HttpServletRequest.class);
    HttpServletResponse response = mock(HttpServletResponse.class);
    given(amLoginModuleBinder.getHttpServletRequest()).willReturn(request);
    given(amLoginModuleBinder.getHttpServletResponse()).willReturn(response);
    given(amLoginModuleBinder.getRequestOrg()).willReturn("REQUEST_ORG");
}
Also used : AMKeyProvider(org.forgerock.openam.utils.AMKeyProvider) HttpServletRequest(javax.servlet.http.HttpServletRequest) CoreWrapper(org.forgerock.openam.core.CoreWrapper) SMSException(com.sun.identity.sm.SMSException) AMLoginModuleBinder(org.forgerock.openam.authentication.modules.common.AMLoginModuleBinder) HttpServletResponse(javax.servlet.http.HttpServletResponse) ServletJwtSessionModule(org.forgerock.jaspi.modules.session.jwt.ServletJwtSessionModule) SSOException(com.iplanet.sso.SSOException) 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