Slf4jLogger implements Logger { @Override public void error( String message, Throwable cause ) { if ( delegate.isErrorEnabled() ) { delegate.error( message, cause ); } } Slf4jLogger( org.slf4j.Logger delegate ); @Override void error( String message, Throwable cause ); @Override void info( String message, Object... params ); @Override void warn( String message, Object... params ); @Override void warn( String message, Throwable cause ); @Override void debug( String message, Object... params ); @Override void trace( String message, Object... params ); @Override boolean isTraceEnabled(); @Override boolean isDebugEnabled();  }
@Test void shouldLogErrorWithMessageAndThrowable() { when( logger.isErrorEnabled() ).thenReturn( true ); String message = "Hello"; IllegalArgumentException error = new IllegalArgumentException( "World" ); slf4jLogger.error( message, error ); verify( logger ).error( message, error ); }