use of org.forgerock.openam.authentication.service.AuthUtilsWrapper 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.authentication.service.AuthUtilsWrapper in project OpenAM by OpenRock.
the class SessionResourceTest method setUp.
@BeforeMethod
public void setUp() throws IdRepoException, SSOException {
SessionQueryManager sessionQueryManager = mock(SessionQueryManager.class);
ssoTokenManager = mock(SSOTokenManager.class);
authUtilsWrapper = mock(AuthUtilsWrapper.class);
propertyWhitelist = mock(SessionPropertyWhitelist.class);
headerResponse = null;
urlResponse = null;
cookieResponse = null;
given(mockContext.getCallerSSOToken()).willReturn(ssoToken);
realmContext = new RealmContext(mockContext);
amIdentity = new AMIdentity(DN.valueOf("id=demo,dc=example,dc=com"), null);
configureWhitelist();
sessionResource = new SessionResource(sessionQueryManager, ssoTokenManager, authUtilsWrapper, propertyWhitelist) {
@Override
AMIdentity getIdentity(SSOToken ssoToken) throws IdRepoException, SSOException {
return amIdentity;
}
@Override
String convertDNToRealm(String dn) {
return "/";
}
@Override
protected String getTokenIdFromHeader(Context context, String cookieName) {
return headerResponse;
}
@Override
protected String getTokenIdFromUrlParam(ActionRequest request) {
return urlResponse;
}
@Override
protected String getTokenIdFromCookie(Context context, String cookieName) {
return cookieResponse;
}
};
}
Aggregations