DefaultBootLogger implements BootLogger { @Override public void trace(Supplier<String> messageSupplier) { if (trace) { stderr(messageSupplier.get()); } } DefaultBootLogger(boolean trace);  DefaultBootLogger(boolean trace, PrintStream stdout, PrintStream stderr); @Override void trace(Supplier<String> messageSupplier); @Override void stdout(String message); @Override void stderr(String message); @Override void stderr(String message, Throwable th);  }
@Test public void testTrace() { DefaultBootLogger logger = new DefaultBootLogger(true, mockStdout, mockStderr); logger.trace(() -> "mytrace"); verify(mockStderr).println("mytrace"); verifyNoInteractions(mockStdout); }
@Test public void testNoTrace() { DefaultBootLogger logger = new DefaultBootLogger(false, mockStdout, mockStderr); logger.trace(() -> "mytrace"); verifyNoInteractions(mockStderr); verifyNoInteractions(mockStdout); }