Deprecated
use SoftAssertionsExtension instead.
Same as SoftAssertions, but with the following differences:
First, it's a JUnit Jupiter extension, which can be used without having to call
assertAll(), example:
public class SoftlyTest {
@RegisterExtension
public final JUnitJupiterSoftAssertions softly = new JUnitJupiterSoftAssertions();
@Test
public void testSoftly() throws Exception {
softly.assertThat(1).isEqualTo(2);
softly.assertThat(Lists.newArrayList(1, 2)).containsOnly(1, 2);
}
}
Second, the failures are recognized by IDE's (like IntelliJ IDEA) which open a comparison window.
| Modifier and Type | Field and Description |
|---|---|
| private AssertionErrorCreator |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | afterEach(ExtensionContext
the current extension context; never extensionContext)nullImplements org. |
| assertionErrorCreator | back to summary |
|---|---|
| private AssertionErrorCreator assertionErrorCreator | |
| JUnitJupiterSoftAssertions | back to summary |
|---|---|
| public JUnitJupiterSoftAssertions() | |
| afterEach | back to summary |
|---|---|
| public void afterEach(ExtensionContext extensionContext) Implements org. Doc from org. Callback that is invoked after an individual test and any user-defined teardown methods for that test have been executed.
| |