Search in sources :

Example 6 with AuditEventHandlerConfiguration

use of org.forgerock.openam.audit.configuration.AuditEventHandlerConfiguration in project OpenAM by OpenRock.

the class AuditServiceProviderImplTest method shouldNotRegisterHandlersWhenFactoryReturnsNull.

@Test
public void shouldNotRegisterHandlersWhenFactoryReturnsNull() throws Exception {
    // Given
    for (AuditEventHandlerConfiguration config : handlerConfigs) {
        config.getAttributes().put("enabled", singleton("false"));
    }
    // When
    configListener.globalConfigurationChanged();
    // Then
    assertThat(provider.getDefaultAuditService().getRegisteredHandler("Mock Handler")).isNull();
    assertThat(provider.getDefaultAuditService().getRegisteredHandler("No such handler")).isNull();
}
Also used : AuditEventHandlerConfiguration(org.forgerock.openam.audit.configuration.AuditEventHandlerConfiguration) Test(org.testng.annotations.Test)

Aggregations

AuditEventHandlerConfiguration (org.forgerock.openam.audit.configuration.AuditEventHandlerConfiguration)6 Test (org.testng.annotations.Test)5 AuditEventHandler (org.forgerock.audit.events.handlers.AuditEventHandler)4 HashMap (java.util.HashMap)3 Set (java.util.Set)3 CsvAuditEventHandler (org.forgerock.audit.handlers.csv.CsvAuditEventHandler)2 HashSet (java.util.HashSet)1 JdbcAuditEventHandler (org.forgerock.audit.handlers.jdbc.JdbcAuditEventHandler)1 SyslogAuditEventHandler (org.forgerock.audit.handlers.syslog.SyslogAuditEventHandler)1 AMAuditServiceConfiguration (org.forgerock.openam.audit.configuration.AMAuditServiceConfiguration)1 BeforeMethod (org.testng.annotations.BeforeMethod)1