StdOutConsole implements Console { public void warn(String message) { warn(message, null); } StdOutConsole(int level); void debug(String message); void info(String message); void warn(String message); void warn(String message, Throwable t);  }
@Test public void testConsoleException() { ByteArrayOutputStream out = new ByteArrayOutputStream(); System.setOut(new PrintStream(out)); ByteArrayOutputStream err = new ByteArrayOutputStream(); System.setErr(new PrintStream(err)); StdOutConsole console = new StdOutConsole(0); console.warn("warning", new Exception("message")); assertTrue(err.toString().contains("warning" + LF + "java.lang.Exception: message")); }