use of org.nhindirect.common.audit.provider.LoggingAuditorProvider in project nhin-d by DirectProject.
the class AuditorFactoryTest method testCreateAuditor_SingleModule_AssertCreatedAuditor.
@Test
public void testCreateAuditor_SingleModule_AssertCreatedAuditor() throws Exception {
LoggingAuditorProvider provider = new LoggingAuditorProvider();
ProviderAuditorModule module = ProviderAuditorModule.create(provider);
Collection<Module> modules = new ArrayList<Module>();
modules.add(module);
Auditor auditor = AuditorFactory.createAuditor(modules);
assertNotNull(auditor);
assertTrue(auditor instanceof LoggingAuditor);
}
use of org.nhindirect.common.audit.provider.LoggingAuditorProvider in project nhin-d by DirectProject.
the class AuditorFactory method createAuditor.
/**
* Creates an {@link Auditor} by searching for configured implementations using Java SPI. If no implementation are found, a default
* instance using the configured logging sub-system is created.
* @return An new auditor instance.
*/
public static synchronized Auditor createAuditor() {
final SPIAuditorProvider spiProv = new SPIAuditorProvider();
final Provider<Auditor> provider = spiProv.isImplementationAvailable() ? spiProv : new LoggingAuditorProvider();
return createAuditor(provider);
}
use of org.nhindirect.common.audit.provider.LoggingAuditorProvider 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.provider.LoggingAuditorProvider in project nhin-d by DirectProject.
the class AuditorFactoryTest method testCreateAuditor_SingleProvider_AssertCreatedAuditor.
@Test
public void testCreateAuditor_SingleProvider_AssertCreatedAuditor() throws Exception {
LoggingAuditorProvider proviver = new LoggingAuditorProvider();
Auditor auditor = AuditorFactory.createAuditor(proviver);
assertNotNull(auditor);
assertTrue(auditor instanceof LoggingAuditor);
}
Aggregations