File tree Expand file tree Collapse file tree
assertj-core/src/main/java/org/assertj/core/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ public SELF hasCause(Throwable cause) {
133133 *
134134 * // This assertion succeeds:
135135 * assertThat(throwable).hasCauseReference(invalidArgException);
136+ * // same assertion but more idiomatic in future versions
137+ * assertThat(throwable).cause().isSameAs(invalidArgException);
136138 *
137139 * // These assertions fail:
138140 * assertThat(throwable).hasCauseReference(new IllegalArgumentException("invalid arg"));
@@ -143,9 +145,12 @@ public SELF hasCause(Throwable cause) {
143145 * @return this assertion object.
144146 * @throws AssertionError if the actual {@code Throwable} is {@code null}.
145147 * @throws AssertionError if the actual {@code Throwable} has a cause that does not refer to the given (i.e. actual.getCause() != cause)
148+ * @deprecated use <code class='java'> cause().isSameAs(expected)</code> instead.
146149 *
147150 * @since 3.13.0
151+ * @see #cause()
148152 */
153+ @ Deprecated
149154 public SELF hasCauseReference (Throwable expected ) {
150155 throwables .assertHasCauseReference (info , actual , expected );
151156 return myself ;
You can’t perform that action at this time.
0 commit comments