use of org.forgerock.openam.audit.AuditServiceProvider 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.audit.AuditServiceProvider in project OpenAM by OpenRock.
the class AbstractRestletAccessAuditFilterTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
restlet = mock(Restlet.class);
AMAuditServiceConfiguration serviceConfig = new AMAuditServiceConfiguration(true);
AuditServiceBuilder builder = AuditServiceBuilder.newAuditService().withConfiguration(serviceConfig);
AMAuditService auditService = new DefaultAuditServiceProxy(builder.build(), serviceConfig);
auditService.startup();
auditServiceProvider = mock(AuditServiceProvider.class);
when(auditServiceProvider.getDefaultAuditService()).thenReturn(auditService);
eventFactory = new AuditEventFactory();
eventPublisher = mock(AuditEventPublisher.class);
auditFilter = new RestletAccessAuditFilterTest(restlet, eventPublisher, eventFactory, null, null);
}
Aggregations