SeverityLevelToken implements Token { @Override public void apply(final LogEntry logEntry, final PreparedStatement statement, final int index) throws SQLException { statement.setString(index, logEntry.getLevel().toString()); } SeverityLevelToken(); @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 applyTrace() throws SQLException { SeverityLevelToken token = new SeverityLevelToken(); PreparedStatement statement = mock(PreparedStatement.class); token.apply(createLogEntry(Level.TRACE), statement, 1); verify(statement).setString(1, "TRACE"); }
@Test public void applyDebug() throws SQLException { SeverityLevelToken token = new SeverityLevelToken(); PreparedStatement statement = mock(PreparedStatement.class); token.apply(createLogEntry(Level.DEBUG), statement, 1); verify(statement).setString(1, "DEBUG"); }
@Test public void applyInfo() throws SQLException { SeverityLevelToken token = new SeverityLevelToken(); PreparedStatement statement = mock(PreparedStatement.class); token.apply(createLogEntry(Level.INFO), statement, 1); verify(statement).setString(1, "INFO"); }
@Test public void applyWarning() throws SQLException { SeverityLevelToken token = new SeverityLevelToken(); PreparedStatement statement = mock(PreparedStatement.class); token.apply(createLogEntry(Level.WARN), statement, 1); verify(statement).setString(1, "WARN"); }
@Test public void applyError() throws SQLException { SeverityLevelToken token = new SeverityLevelToken(); PreparedStatement statement = mock(PreparedStatement.class); token.apply(createLogEntry(Level.ERROR), statement, 1); verify(statement).setString(1, "ERROR"); }