ActionLog { public String errorCode() { if (errorCode != null) return errorCode; if (result.value >= WARN.value) return "UNASSIGNED"; return null; } ActionLog(String message, String id); long elapsed(); String errorCode(); void context(String key, Object... values); void stat(String key, double value); int track(String operation, long elapsed, int readEntries, int writeEntries); String correlationId(); void action(String action); final String id; final Map<String, List<String>> context; final Map<String, Double> stats; final Instant date; public boolean trace; public String action; public List<String> correlationIds; public List<String> clients; public List<String> refIds; public boolean suppressSlowSQLWarning; }
@Test void errorCode() { assertThat(log.errorCode()).isNull(); log.process(new LogEvent("logger", null, LogLevel.WARN, null, null, null)); assertThat(log.errorCode()).isEqualTo("UNASSIGNED"); }