Search in sources :

Example 6 with NoOpAuditor

use of org.nhindirect.common.audit.impl.NoOpAuditor in project nhin-d by DirectProject.

the class MultiProviderAuditorTest method testAuditWithContext.

@Test
public void testAuditWithContext() {
    Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new NoOpAuditor()));
    Collection<? extends AuditContext> ctx = Arrays.asList(new DefaultAuditContext("name", "value"));
    auditor.audit(PRINCIPAL, UNIT_TEST_EVENT, ctx);
}
Also used : LoggingAuditor(org.nhindirect.common.audit.impl.LoggingAuditor) Auditor(org.nhindirect.common.audit.Auditor) MultiProviderAuditor(org.nhindirect.common.audit.impl.MultiProviderAuditor) NoOpAuditor(org.nhindirect.common.audit.impl.NoOpAuditor) DefaultAuditContext(org.nhindirect.common.audit.DefaultAuditContext) MultiProviderAuditor(org.nhindirect.common.audit.impl.MultiProviderAuditor) NoOpAuditor(org.nhindirect.common.audit.impl.NoOpAuditor) LoggingAuditor(org.nhindirect.common.audit.impl.LoggingAuditor) Test(org.junit.Test)

Example 7 with NoOpAuditor

use of org.nhindirect.common.audit.impl.NoOpAuditor in project nhin-d by DirectProject.

the class AuditorFactoryTest method testCreateAuditor_SingleSPIImplementation_AssertCreatedSPIAuditor.

@Test
public void testCreateAuditor_SingleSPIImplementation_AssertCreatedSPIAuditor() throws Exception {
    setupSPIImplementation(NoOpAuditor.class);
    Auditor auditor = AuditorFactory.createAuditor();
    assertNotNull(auditor);
    assertTrue(auditor instanceof NoOpAuditor);
}
Also used : LoggingAuditor(org.nhindirect.common.audit.impl.LoggingAuditor) MultiProviderAuditor(org.nhindirect.common.audit.impl.MultiProviderAuditor) NoOpAuditor(org.nhindirect.common.audit.impl.NoOpAuditor) NoOpAuditor(org.nhindirect.common.audit.impl.NoOpAuditor) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)7 LoggingAuditor (org.nhindirect.common.audit.impl.LoggingAuditor)7 MultiProviderAuditor (org.nhindirect.common.audit.impl.MultiProviderAuditor)7 NoOpAuditor (org.nhindirect.common.audit.impl.NoOpAuditor)7 Auditor (org.nhindirect.common.audit.Auditor)5 DefaultAuditContext (org.nhindirect.common.audit.DefaultAuditContext)1 MultiProviderAuditorProvider (org.nhindirect.common.audit.provider.MultiProviderAuditorProvider)1