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);
}
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);
}
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);
}
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);
}
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");
}
Aggregations