@Test public void bar_shouldLogAnUnknownErrorMessageAndThrowAnException() throws Exception { try { theClass.bar(); fail("expected an exception"); } catch (RuntimeException e) { verify(mockLogger).logThrowable(CollectorLogMessages.UNKNOWN_ERROR, e); } }
public void bar() { RuntimeException e = new RuntimeException(); logger.logThrowable(UNKNOWN_ERROR, e); throw e; }
ClassThatLogs { public void bar() { RuntimeException e = new RuntimeException(); logger.logThrowable(UNKNOWN_ERROR, e); throw e; } }
ClassThatLogs { public void bar() { RuntimeException e = new RuntimeException(); logger.logThrowable(UNKNOWN_ERROR, e); throw e; } ClassThatLogs(OpsLogger<CollectorLogMessages> logger); }
ClassThatLogs { public void bar() { RuntimeException e = new RuntimeException(); logger.logThrowable(UNKNOWN_ERROR, e); throw e; } ClassThatLogs(OpsLogger<CollectorLogMessages> logger); void foo(); void bar(); String logContextsAcrossThreads(); void baz(); }
ClassThatLogs { public void bar() { RuntimeException e = new RuntimeException(); logger.logThrowable(UNKNOWN_ERROR, e); throw e; } ClassThatLogs(OpsLogger<CollectorLogMessages> logger); void foo(); void bar(); String logContextsAcrossThreads(); void baz();  }