TinylogLog implements Log { @Override public void warn(final Object message) { if (MINIMUM_LEVEL_COVERS_WARN) { provider.log(STACKTRACE_DEPTH, null, Level.WARN, null, null, message); } } TinylogLog(); @Override boolean isTraceEnabled(); @Override void trace(final Object message); @Override void trace(final Object message, final Throwable exception); @Override boolean isDebugEnabled(); @Override void debug(final Object message); @Override void debug(final Object message, final Throwable exception); @Override boolean isInfoEnabled(); @Override void info(final Object message); @Override void info(final Object message, final Throwable exception); @Override boolean isWarnEnabled(); @Override void warn(final Object message); @Override void warn(final Object message, final Throwable exception); @Override boolean isErrorEnabled(); @Override void error(final Object message); @Override void error(final Object message, final Throwable exception); @Override boolean isFatalEnabled(); @Override void fatal(final Object message); @Override void fatal(final Object message, final Throwable exception);  }
@Test public void warnMessage() { log.warn("Hello World!"); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, null, null, "Hello World!"); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any()); } }
@Test public void warnException() { RuntimeException exception = new RuntimeException(); log.warn(exception, exception); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, exception, null, null); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any()); } }
@Test public void warnMessageAndException() { RuntimeException exception = new RuntimeException(); log.warn("Boom!", exception); if (warnEnabled) { verify(provider).log(2, null, Level.WARN, exception, null, "Boom!"); } else { verify(provider, never()).log(anyInt(), anyString(), any(), any(), any(), any()); } }