Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/org/assertj/core/api/WithAssertions.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ default <K, V> MapEntry<K, V> entry(final K key, final V value) {
* @return nothing, it's just to be used in doSomething(optional.orElse(() -&gt; fail("boom")));.
* @throws AssertionError with the given message.
*/
@CanIgnoreReturnValue
default <T> T fail(final String failureMessage) {
return Assertions.fail(failureMessage);
}
Expand All @@ -172,6 +173,7 @@ default <T> T fail(final String failureMessage) {
* @throws AssertionError with the given built message.
* @since 3.9.0
*/
@CanIgnoreReturnValue
default <T> T fail(String failureMessage, Object... args) {
return Assertions.fail(failureMessage, args);
}
Expand All @@ -185,6 +187,7 @@ default <T> T fail(String failureMessage, Object... args) {
* @return nothing, it's just to be used in doSomething(optional.orElse(() -&gt; fail("boom", cause)));.
* @throws AssertionError with the given message and with the {@link Throwable} that caused the failure.
*/
@CanIgnoreReturnValue
default <T> T fail(final String failureMessage, final Throwable realCause) {
return Assertions.fail(failureMessage, realCause);
}
Expand Down Expand Up @@ -1792,6 +1795,7 @@ default void setRemoveAssertJRelatedElementsFromStackTrace(final boolean removeA
* @throws AssertionError with a message explaining that a {@link Throwable} of given class was expected to be thrown but had
* not been.
*/
@CanIgnoreReturnValue
default <T> T failBecauseExceptionWasNotThrown(final Class<? extends Throwable> throwableClass) {
return Assertions.failBecauseExceptionWasNotThrown(throwableClass);
}
Expand All @@ -1806,6 +1810,7 @@ default <T> T failBecauseExceptionWasNotThrown(final Class<? extends Throwable>
* not been.
* @since 3.9.0
*/
@CanIgnoreReturnValue
default <T> T shouldHaveThrown(Class<? extends Throwable> throwableClass) {
return Assertions.shouldHaveThrown(throwableClass);
}
Expand Down