Class SoftThrowableAssertAlternative<ACTUAL extends Throwable>

All Implemented Interfaces:
Assert<ThrowableAssertAlternative<ACTUAL>,ACTUAL>, Descriptable<ThrowableAssertAlternative<ACTUAL>>, ExtensionPoints<ThrowableAssertAlternative<ACTUAL>,ACTUAL>

public class SoftThrowableAssertAlternative<ACTUAL extends Throwable> extends ThrowableAssertAlternative<ACTUAL>
ThrowableAssertAlternative subclass used in soft assertions.

Assertion methods for Throwable similar to ThrowableAssert but with assertions methods named differently to make testing code fluent (ex : withMessage instead of hasMessage).

 SoftAssertions softly = new SoftAssertions();
 
 softly.assertThatExceptionOfType(IOException.class)
           .isThrownBy(() -> { throw new IOException("boom! tcha!"); });
           .withMessage("boom! %s", "tcha!"); 
This class is linked with the ThrowableTypeAssert and allow to check that an exception type is thrown by a lambda.
Since:
3.23.0