public DittoRuntimeAssert hasCause(final Throwable expectedCause) { isNotNull(); final Throwable actualCause = actual.getCause(); assertThat(actualCause) // .overridingErrorMessage("Expected cause of DittoRuntimeException to be \n<%s> but it was \n<%s>", expectedCause, actualCause) // .isEqualTo(expectedCause); return this; }
/** * Construct a builder {@code b} such that {@code b.build()} has identical class and fields as {@code this}. * <p> * A subclass should extend this method if it adds another field. * * @return A builder to construct an identical copy of {@code this}. */ public DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> getBuilder() { return getEmptyBuilder() .dittoHeaders(dittoHeaders) .message(getMessage()) .cause(getCause()) .description(description) .href(href); }
/** * Construct a builder {@code b} such that {@code b.build()} has identical class and fields as {@code this}. * <p> * A subclass should extend this method if it adds another field. * * @return A builder to construct an identical copy of {@code this}. */ public DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> getBuilder() { return getEmptyBuilder() .dittoHeaders(dittoHeaders) .message(getMessage()) .cause(getCause()) .description(description) .href(href); }
/** * Returns a new mutable builder with a fluent API for a {@code dittoRuntimeException}. The builder is already * initialized with the properties of the given exception. * * @param dittoRuntimeException the exception to be copied. * @return the new builder. * @throws NullPointerException if {@code dittoRuntimeException} is {@code null}. */ public static DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> newBuilder( final DittoRuntimeException dittoRuntimeException) { checkNotNull(dittoRuntimeException, "dittoRuntimeException to be copied"); return dittoRuntimeException.getBuilder() .dittoHeaders(dittoRuntimeException.dittoHeaders) .message(dittoRuntimeException.getMessage()) .description(dittoRuntimeException.description) .cause(dittoRuntimeException.getCause()) .href(dittoRuntimeException.href); }
/** * Returns a new mutable builder with a fluent API for a {@code dittoRuntimeException}. The builder is already * initialized with the properties of the given exception. * * @param dittoRuntimeException the exception to be copied. * @return the new builder. * @throws NullPointerException if {@code dittoRuntimeException} is {@code null}. */ public static DittoRuntimeExceptionBuilder<? extends DittoRuntimeException> newBuilder( final DittoRuntimeException dittoRuntimeException) { checkNotNull(dittoRuntimeException, "dittoRuntimeException to be copied"); return dittoRuntimeException.getBuilder() .dittoHeaders(dittoRuntimeException.dittoHeaders) .message(dittoRuntimeException.getMessage()) .description(dittoRuntimeException.description) .cause(dittoRuntimeException.getCause()) .href(dittoRuntimeException.href); }