use of org.nhindirect.common.audit.impl.MultiProviderAuditor in project nhin-d by DirectProject.
the class MultiProviderAuditorProviderTest method testCreateProviderFromAuditorArray.
@Test
public void testCreateProviderFromAuditorArray() {
MultiProviderAuditorProvider provider = new MultiProviderAuditorProvider(new Auditor[] { new NoOpAuditor(), new LoggingAuditor() });
assertNotNull(provider);
assertNotNull(provider.get());
assertTrue(provider.get() instanceof MultiProviderAuditor);
}
use of org.nhindirect.common.audit.impl.MultiProviderAuditor in project nhin-d by DirectProject.
the class MultiProviderAuditorProviderTest method testCreateProviderFromAuditorcollection.
@SuppressWarnings("unchecked")
@Test
public void testCreateProviderFromAuditorcollection() {
Provider<Auditor>[] provs = new Provider[2];
provs[0] = new NoOpAuditorProvider();
provs[1] = new LoggingAuditorProvider();
MultiProviderAuditorProvider provider = new MultiProviderAuditorProvider(provs);
assertNotNull(provider);
assertNotNull(provider.get());
assertTrue(provider.get() instanceof MultiProviderAuditor);
}
use of org.nhindirect.common.audit.impl.MultiProviderAuditor in project nhin-d by DirectProject.
the class SPIAuditorProviderTest method testCreateSingleAuditorFromSPI_AssertMutliProviderAuditorCreated.
@Test
public void testCreateSingleAuditorFromSPI_AssertMutliProviderAuditorCreated() throws Exception {
setupSPIImplementation(LoggingAuditor.class);
setupSPIImplementation(NoOpAuditor.class);
SPIAuditorProvider prov = new SPIAuditorProvider();
assertTrue(prov.isImplementationAvailable());
assertNotNull(prov.get());
assertTrue(prov.get() instanceof MultiProviderAuditor);
}
use of org.nhindirect.common.audit.impl.MultiProviderAuditor in project nhin-d by DirectProject.
the class SPIAuditorProviderTest method testCreateSingleAuditorFromSPI_NullConstructor_AssertMutliProviderAuditorCreated.
@Test
public void testCreateSingleAuditorFromSPI_NullConstructor_AssertMutliProviderAuditorCreated() throws Exception {
setupSPIImplementation(LoggingAuditor.class);
setupSPIImplementation(NoOpAuditor.class);
SPIAuditorProvider prov = new SPIAuditorProvider(null);
assertTrue(prov.isImplementationAvailable());
assertNotNull(prov.get());
assertTrue(prov.get() instanceof MultiProviderAuditor);
}
use of org.nhindirect.common.audit.impl.MultiProviderAuditor in project nhin-d by DirectProject.
the class MultiProviderAuditorTest method testAuditCategoryAndMessage_OneAuditorFails.
@Test
public void testAuditCategoryAndMessage_OneAuditorFails() {
Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new ExceptionAuditor()));
auditor.audit(PRINCIPAL, UNIT_TEST_EVENT);
}
Aggregations