AuditLogger extends AbstractEventLogger { @Override protected void logEvent(StructuredDataMessage message) { LOGGER.logIfEnabled(FQCN, Level.OFF, EVENT_MARKER, message, null); } AuditLogger();  AuditLogger(int maxLength);   }
@Test(expected = ConstraintValidationException.class) public void testMissingRequestContextAttribute() { auditLogger = buildAuditLogger(catalogReader); Map<String, String> properties = new HashMap<>(); properties.put("toAccount", "123456"); properties.put("fromAccount", "111111"); properties.put("amount", "111.55"); auditLogger.logEvent("transfer", properties); }
@Test(expected = ConstraintValidationException.class) public void testMissingEventAttribute() { auditLogger = buildAuditLogger(catalogReader); ThreadContext.put("companyId", "12345"); ThreadContext.put("ipAddress", "127.0.0.1"); ThreadContext.put("environment", "dev"); ThreadContext.put("product", "TestProduct"); ThreadContext.put("timeZone", "America/Phoenix"); ThreadContext.put("loginId", "TestUser"); Map<String, String> properties = new HashMap<>(); properties.put("toAccount", "123456"); properties.put("amount", "111.55"); auditLogger.logEvent("transfer", properties); }
@Test public void testAuditLoggerWithBasicCatalog() throws Exception { auditLogger = buildAuditLogger(new ClassPathCatalogReader(Collections.singletonMap("catalogFile", "basicCatalog.json"))); auditLogger.logEvent("login", null); }