use of org.forgerock.openam.audit.AuditEventFactory 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);
}
use of org.forgerock.openam.audit.AuditEventFactory in project OpenAM by OpenRock.
the class AuditTestUtils method mockAuditEventFactory.
public static AuditEventFactory mockAuditEventFactory() {
AuditEventFactory auditEventFactory = mock(AuditEventFactory.class);
when(auditEventFactory.accessEvent(NO_REALM)).thenAnswer(new Answer<AMAccessAuditEventBuilder>() {
@Override
public AMAccessAuditEventBuilder answer(InvocationOnMock invocation) throws Throwable {
return new AMAccessAuditEventBuilder();
}
});
return auditEventFactory;
}
Aggregations