Skip to content

SoftAssertions#fail(String failureMessage, Throwable realCause) display information about realCause? #864

@PascalSchumacher

Description

@PascalSchumacher

While taking a look at #539 I noticed that SoftAssertions#fail(String failureMessage, Throwable realCause) could be more useful, at the moment it does not show any information about realCause.

@Test
public void test() {
    softly.fail("failure", new RuntimeException("abc"));
    softly.assertAll();
}

just displays:

org.assertj.core.api.SoftAssertionError:
The following assertion failed:

  1. failure

    at org.assertj.core.api.SoftAssertions.assertAll(SoftAssertions.java:116)
    at org.assertj.core.api.SoftAssertionsTest.test(SoftAssertionsTest.java:115)

The error message etc. of realCause is lost.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions