SimpleClassNameToken implements Token { @Override public void render(final LogEntry logEntry, final StringBuilder builder) { builder.append(getSimpleClassName(logEntry.getClassName())); } SimpleClassNameToken(); @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 renderClassWithPackage() { SimpleClassNameToken token = new SimpleClassNameToken(); assertThat(render(token, "my.package.TestClass")).isEqualTo("TestClass"); }
@Test public void renderClassWithoutPackage() { SimpleClassNameToken token = new SimpleClassNameToken(); assertThat(render(token, "AnotherClass")).isEqualTo("AnotherClass"); }
@Test public void renderClassWithoutPackageIfClassnameIsNull() { SimpleClassNameToken token = new SimpleClassNameToken(); assertThat(render(token, null)).isEqualTo("null"); }