SoftAssertions.assertSoftly(..) allows multiple assertions at once. It is similar to JUnit5 assertAll(executables).
It requires that assertThat(..) from softly is called otherwise only the first failing assertion terminates the test and the usage assertSoftly is pointless.
Given: Person person = new Person("John", 25);
Noncompliant Code
SoftAssertions.assertSoftly(softly -> {
assertThat(person.name()).isEqualTo("Paul");
assertThat(person.age()).isEqualTo(-1);
});
Compilant Code
SoftAssertions.assertSoftly(softly -> {
softly.assertThat(person.name()).isEqualTo("Paul");
softly.assertThat(person.age()).isEqualTo(-1);
});