Class JUnitBDDSoftAssertions

All Implemented Interfaces:
AfterAssertionErrorCollected, AssertionErrorCollector, BDDSoftAssertionsProvider, InstanceOfAssertFactories, Java6BDDSoftAssertionsProvider, SoftAssertionsProvider, SoftAssertionsRule, org.junit.rules.TestRule

public class JUnitBDDSoftAssertions extends AbstractSoftAssertions implements BDDSoftAssertionsProvider, SoftAssertionsRule
Same as SoftAssertions, but with the following differences:
First, it's a junit rule, which can be used without having to call assertAll(), example:
 public class SoftlyTest {

    @Rule
    public final JUnitBDDSoftAssertions softly = new JUnitBDDSoftAssertions();

    @Test
    public void soft_bdd_assertions() throws Exception {
      softly.then(1).isEqualTo(2);
      softly.then(Lists.newArrayList(1, 2)).containsOnly(1, 2);
    }
 }
Second, the failures are recognized by IDE's (like IntelliJ IDEA) which open a comparison window.
  • Constructor Details

    • JUnitBDDSoftAssertions

      public JUnitBDDSoftAssertions()