Class JUnitJupiterSoftAssertions

  • All Implemented Interfaces:
    InstanceOfAssertFactories, org.junit.jupiter.api.extension.AfterEachCallback, org.junit.jupiter.api.extension.Extension

    @Deprecated
    public class JUnitJupiterSoftAssertions
    extends AbstractStandardSoftAssertions
    implements org.junit.jupiter.api.extension.AfterEachCallback
    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.
    • Constructor Detail

      • JUnitJupiterSoftAssertions

        public JUnitJupiterSoftAssertions()
        Deprecated.
    • Method Detail

      • afterEach

        public void afterEach​(org.junit.jupiter.api.extension.ExtensionContext extensionContext)
        Deprecated.
        Specified by:
        afterEach in interface org.junit.jupiter.api.extension.AfterEachCallback