@Test public void runtime_exception_containing_a_HttpClientErrorException_find_root_HttpClientErrorException() { Throwable wantedrootCause = new HttpClientErrorException(HttpStatus.BAD_REQUEST); RuntimeException e = new RuntimeException("test", wantedrootCause); Throwable rootCause = StacktraceUtil.findRootCause(e); assertEquals(wantedrootCause,rootCause); }
public static Throwable findRootCause(Throwable throwable) { if (throwable == null) { return null; } Throwable rootCause = throwable; while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } return rootCause; }
StacktraceUtil { public static Throwable findRootCause(Throwable throwable) { if (throwable == null) { return null; } Throwable rootCause = throwable; while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } return rootCause; } }
StacktraceUtil { public static Throwable findRootCause(Throwable throwable) { if (throwable == null) { return null; } Throwable rootCause = throwable; while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } return rootCause; }  }
StacktraceUtil { public static Throwable findRootCause(Throwable throwable) { if (throwable == null) { return null; } Throwable rootCause = throwable; while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } return rootCause; }  static Throwable findRootCause(Throwable throwable); static String createDescription(Throwable throwable); }
StacktraceUtil { public static Throwable findRootCause(Throwable throwable) { if (throwable == null) { return null; } Throwable rootCause = throwable; while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } return rootCause; }  static Throwable findRootCause(Throwable throwable); static String createDescription(Throwable throwable);  }