use of org.nhindirect.common.audit.module.ProviderAuditorModule 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.module.ProviderAuditorModule in project nhin-d by DirectProject.
the class AuditorFactory method createAuditor.
/**
* Creates an {@link Auditor} using a Guice provider.
* @param provider The provider using to create Auditor instances.
* @return An new auditor instance.
*/
public static synchronized Auditor createAuditor(Provider<Auditor> provider) {
if (provider == null)
throw new IllegalArgumentException("Provider cannot be null.");
final ProviderAuditorModule module = ProviderAuditorModule.create(provider);
final Collection<Module> modules = new ArrayList<Module>();
modules.add(module);
return createAuditor(modules);
}
Aggregations