use of org.nhindirect.common.audit.Auditor in project nhin-d by DirectProject.
the class MultiProviderAuditorTest method testAuditEvent.
@Test
public void testAuditEvent() {
Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new NoOpAuditor()));
auditor.audit(PRINCIPAL, UNIT_TEST_EVENT);
}
use of org.nhindirect.common.audit.Auditor in project nhin-d by DirectProject.
the class MultiProviderAuditorTest method testAuditCategoryAndMessage_EmptyPrincipal_AssertExeption.
@Test
public void testAuditCategoryAndMessage_EmptyPrincipal_AssertExeption() {
Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new NoOpAuditor()));
boolean exceptionOccured = false;
try {
auditor.audit("", UNIT_TEST_EVENT);
} catch (IllegalArgumentException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.common.audit.Auditor in project nhin-d by DirectProject.
the class MultiProviderAuditorTest method testAudit_NullPrincipal_AssertExeption.
@Test
public void testAudit_NullPrincipal_AssertExeption() {
Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new NoOpAuditor()));
boolean exceptionOccured = false;
try {
auditor.audit(null, UNIT_TEST_EVENT);
} catch (IllegalArgumentException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
use of org.nhindirect.common.audit.Auditor 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);
}
use of org.nhindirect.common.audit.Auditor in project nhin-d by DirectProject.
the class MultiProviderAuditorTest method testAudit_NullEvent_AssertExeption.
@Test
public void testAudit_NullEvent_AssertExeption() {
Auditor auditor = new MultiProviderAuditor(Arrays.asList(new LoggingAuditor(), new NoOpAuditor()));
boolean exceptionOccured = false;
try {
auditor.audit(PRINCIPAL, null);
} catch (IllegalArgumentException e) {
exceptionOccured = true;
}
assertTrue(exceptionOccured);
}
Aggregations