Summary
When using SoftAssertions together with satisfies() or allSatisfy() the additional assertions made in the consumer supplied to these methods are handled differently. In fact, the first failing assertion prevents other in the same consumer to be reported, as expected.
Example
public class MyTest {
@Test
public void softAssertionTest() {
String str = "hello";
SoftAssertions.assertSoftly(sa -> {
sa.assertThat(str).satisfies(s -> {
// fails
sa.assertThat(s).hasSize(2);
// not reported, unless all previous assertions succeed
sa.assertThat(s).isEmpty();
});
});
}
}
Summary
When using SoftAssertions together with satisfies() or allSatisfy() the additional assertions made in the consumer supplied to these methods are handled differently. In fact, the first failing assertion prevents other in the same consumer to be reported, as expected.
Example