FileNameToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { String fileName = logEntry.getFileName(); if (fileName == null) { builder.append("<unknown>"); } else { builder.append(fileName); } } FileNameToken(); @Override Collection<LogEntryValue> getRequiredLogEntryValues(); @Override void render(final LogEntry logEntry, final StringBuilder builder); @Override void apply(final LogEntry logEntry, final PreparedStatement statement, final int index);  }
@Test public void renderFileName() { FileNameToken token = new FileNameToken(); assertThat(render(token, "TestClass.java")).isEqualTo("TestClass.java"); }
@Test public void renderNull() { FileNameToken token = new FileNameToken(); assertThat(render(token, null)).isEqualTo("<unknown>"); }