BundleToken implements Token { @Override public void apply(final LogEntry logEntry, final PreparedStatement statement, final int index) throws SQLException { StringBuilder builder = new StringBuilder(); render(logEntry, builder); statement.setString(index, builder.toString()); } BundleToken(final Collection<Token> tokens); @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 apply() throws SQLException { BundleToken token = new BundleToken(asList(new PlainTextToken("Abc"), new PlainTextToken("123"))); PreparedStatement statement = mock(PreparedStatement.class); token.apply(LogEntryBuilder.empty().create(), statement, 1); verify(statement).setString(1, "Abc123"); }