use of org.nhindirect.common.audit.impl.LoggingAuditor 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.impl.LoggingAuditor in project nhin-d by DirectProject.
the class AuditorFactoryTest method testCreateAuditor_NoSPI_AssertCreatedDefaultAuditor.
@Test
public void testCreateAuditor_NoSPI_AssertCreatedDefaultAuditor() {
Auditor auditor = AuditorFactory.createAuditor();
assertNotNull(auditor);
assertTrue(auditor instanceof LoggingAuditor);
}
use of org.nhindirect.common.audit.impl.LoggingAuditor in project nhin-d by DirectProject.
the class SPIAuditorProviderTest method testCreateSingleAuditorFromSPI_AssertAuditorInstanceOf.
@Test
public void testCreateSingleAuditorFromSPI_AssertAuditorInstanceOf() throws Exception {
setupSPIImplementation(LoggingAuditor.class);
SPIAuditorProvider prov = new SPIAuditorProvider();
assertTrue(prov.isImplementationAvailable());
assertNotNull(prov.get());
assertTrue(prov.get() instanceof LoggingAuditor);
}
use of org.nhindirect.common.audit.impl.LoggingAuditor in project nhin-d by DirectProject.
the class LoggingAuditorTest method testAuditEvent.
@Test
public void testAuditEvent() {
LoggingAuditor auditor = new LoggingAuditor();
auditor.audit(PRINCIPAL, UNIT_TEST_EVENT);
}
use of org.nhindirect.common.audit.impl.LoggingAuditor in project nhin-d by DirectProject.
the class LoggingAuditorTest method testAudit_NullEvent_AssertExeption.
@Test
public void testAudit_NullEvent_AssertExeption() {
LoggingAuditor auditor = new LoggingAuditor();
boolean exceptionOccured = false;
try {
auditor.audit(PRINCIPAL, null);
} catch (IllegalArgumentException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations