@Test void shouldReturnCausesMessage() { final ThrowableProblem problem = Problem.builder() .withType(URI.create("https: .withTitle("Preauthorization Failed") .withStatus(BAD_REQUEST) .withCause(Problem.builder() .withType(URI.create("https: .withTitle("Expired Credit Card") .withStatus(BAD_REQUEST) .build()) .build(); assertThat(problem, hasFeature("cause", Throwable::getCause, is(notNullValue()))); assertThat(problem.getCause(), hasFeature("message", Throwable::getMessage, is("Expired Credit Card"))); }
@Override public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); }
ThrowableProblem extends RuntimeException implements Problem, Exceptional { @Override public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); } }
ThrowableProblem extends RuntimeException implements Problem, Exceptional { @Override public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); } protected  ThrowableProblem(); protected  ThrowableProblem(@Nullable final ThrowableProblem cause); }
ThrowableProblem extends RuntimeException implements Problem, Exceptional { @Override public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); } protected  ThrowableProblem(); protected  ThrowableProblem(@Nullable final ThrowableProblem cause); @Override String getMessage(); @Override ThrowableProblem getCause(); @Override String toString(); }
ThrowableProblem extends RuntimeException implements Problem, Exceptional { @Override public ThrowableProblem getCause() { return (ThrowableProblem) super.getCause(); } protected  ThrowableProblem(); protected  ThrowableProblem(@Nullable final ThrowableProblem cause); @Override String getMessage(); @Override ThrowableProblem getCause(); @Override String toString();  }