Class JUnitSoftAssertions
java.lang.Object
org.assertj.core.api.DefaultAssertionErrorCollector
org.assertj.core.api.AbstractSoftAssertions
org.assertj.core.api.JUnitSoftAssertions
- All Implemented Interfaces:
AfterAssertionErrorCollected, AssertionErrorCollector, InstanceOfAssertFactories, Java6StandardSoftAssertionsProvider, SoftAssertionsProvider, SoftAssertionsRule, StandardSoftAssertionsProvider, org.junit.rules.TestRule
public class JUnitSoftAssertions
extends AbstractSoftAssertions
implements StandardSoftAssertionsProvider, SoftAssertionsRule
Same as
First, it's a junit rule, which can be used without having to call
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 JUnitSoftAssertions softly = new JUnitSoftAssertions();
@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.-
Nested Class Summary
Nested classes/interfaces inherited from interface SoftAssertionsProvider
SoftAssertionsProvider.ThrowingRunnable -
Field Summary
Fields inherited from interface InstanceOfAssertFactories
ARRAY, ARRAY_2D, ATOMIC_BOOLEAN, ATOMIC_INTEGER, ATOMIC_INTEGER_ARRAY, ATOMIC_INTEGER_FIELD_UPDATER, ATOMIC_LONG, ATOMIC_LONG_ARRAY, ATOMIC_LONG_FIELD_UPDATER, ATOMIC_MARKABLE_REFERENCE, ATOMIC_REFERENCE, ATOMIC_REFERENCE_ARRAY, ATOMIC_REFERENCE_FIELD_UPDATER, ATOMIC_STAMPED_REFERENCE, BIG_DECIMAL, BIG_INTEGER, BOOLEAN, BOOLEAN_2D_ARRAY, BOOLEAN_ARRAY, BYTE, BYTE_2D_ARRAY, BYTE_ARRAY, CHAR_2D_ARRAY, CHAR_ARRAY, CHAR_SEQUENCE, CHARACTER, CLASS, COLLECTION, COMPLETABLE_FUTURE, COMPLETION_STAGE, DATE, DOUBLE, DOUBLE_2D_ARRAY, DOUBLE_ARRAY, DOUBLE_PREDICATE, DOUBLE_STREAM, DURATION, FILE, FLOAT, FLOAT_2D_ARRAY, FLOAT_ARRAY, FUTURE, INPUT_STREAM, INSTANT, INT_2D_ARRAY, INT_ARRAY, INT_PREDICATE, INT_STREAM, INTEGER, ITERABLE, ITERATOR, LIST, LOCAL_DATE, LOCAL_DATE_TIME, LOCAL_TIME, LONG, LONG_2D_ARRAY, LONG_ADDER, LONG_ARRAY, LONG_PREDICATE, LONG_STREAM, MAP, MATCHER, OFFSET_DATE_TIME, OFFSET_TIME, OPTIONAL, OPTIONAL_DOUBLE, OPTIONAL_INT, OPTIONAL_LONG, PATH, PERIOD, PREDICATE, SET, SHORT, SHORT_2D_ARRAY, SHORT_ARRAY, SPLITERATOR, STREAM, STRING, STRING_BUFFER, STRING_BUILDER, TEMPORAL, THROWABLE, URI_TYPE, URL_TYPE, YEAR_MONTH, ZONED_DATE_TIME -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractSoftAssertions
assertAll, assertAll, errorsCollected, fail, fail, fail, fail, fail, failBecauseExceptionWasNotThrown, proxy, shouldHaveThrownMethods inherited from class DefaultAssertionErrorCollector
addAfterAssertionErrorCollected, assertionErrorsCollected, collectAssertionError, decorateErrorsCollected, getDelegate, setAfterAssertionErrorCollected, setDelegate, succeeded, wasSuccessMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AssertionErrorCollector
assertionErrorsCollected, collectAssertionError, getDelegate, onAssertionErrorCollected, setDelegate, succeeded, wasSuccessMethods inherited from interface Java6StandardSoftAssertionsProvider
assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThatCharSequence, assertThatCode, assertThatCollection, assertThatComparable, assertThatException, assertThatExceptionOfType, assertThatIllegalArgumentException, assertThatIllegalStateException, assertThatIndexOutOfBoundsException, assertThatIOException, assertThatIterable, assertThatIterator, assertThatList, assertThatNullPointerException, assertThatObject, assertThatReflectiveOperationException, assertThatRuntimeException, assertThatThrownBy, assertThatThrownByMethods inherited from interface SoftAssertionsProvider
assertAll, assertAlso, check, proxyMethods inherited from interface SoftAssertionsRule
applyMethods inherited from interface StandardSoftAssertionsProvider
assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThat, assertThatPath, assertThatPredicate, assertThatStream, assertThatTemporal
-
Constructor Details
-
JUnitSoftAssertions
public JUnitSoftAssertions()
-