Package org.assertj.core.api
Class FactoryBasedNavigableListAssert<SELF extends FactoryBasedNavigableListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends List<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,ACTUAL>
-
- org.assertj.core.api.AbstractIterableAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- org.assertj.core.api.AbstractCollectionAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- org.assertj.core.api.AbstractListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- org.assertj.core.api.FactoryBasedNavigableListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
-
- All Implemented Interfaces:
Assert<SELF,ACTUAL>
,Descriptable<SELF>
,EnumerableAssert<SELF,ELEMENT>
,ExtensionPoints<SELF,ACTUAL>
,IndexedObjectEnumerableAssert<SELF,ELEMENT>
,ObjectEnumerableAssert<SELF,ELEMENT>
- Direct Known Subclasses:
ListAssert
public class FactoryBasedNavigableListAssert<SELF extends FactoryBasedNavigableListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends List<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>> extends AbstractListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>
Provides helper methods for navigating a list property in a generated assertion class so we can chain assertions through deeply nested models more easily.- Since:
- 2.5.0 / 3.5.0
-
-
Field Summary
Fields Modifier and Type Field Description private AssertFactory<ELEMENT,ELEMENT_ASSERT>
assertFactory
-
Fields inherited from class org.assertj.core.api.AbstractListAssert
lists
-
Fields inherited from class org.assertj.core.api.AbstractIterableAssert
iterables
-
Fields inherited from class org.assertj.core.api.AbstractAssert
actual, assertionErrorCreator, conditions, customRepresentation, info, myself, objects, printAssertionsDescription, throwUnsupportedExceptionOnEquals
-
-
Constructor Summary
Constructors Constructor Description FactoryBasedNavigableListAssert(ACTUAL actual, Class<?> selfType, AssertFactory<ELEMENT,ELEMENT_ASSERT> assertFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SELF
newAbstractIterableAssert(Iterable<? extends ELEMENT> iterable)
This methods is needed to build a new concrete instance of AbstractIterableAssert after a filtering operation is executed.ELEMENT_ASSERT
toAssert(ELEMENT value, String description)
This method is used in navigating assertions likeAbstractIterableAssert.first()
,AbstractIterableAssert.last()
andAbstractIterableAssert.element(int)
to build the assertion for the given element navigated to.-
Methods inherited from class org.assertj.core.api.AbstractListAssert
as, as, contains, describedAs, describedAs, doesNotContain, doesNotHave, doesNotHaveSameClassAs, has, has, hasSameClassAs, hasToString, is, is, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isOfAnyClassIn, isSameAs, isSorted, isSortedAccordingTo, overridingErrorMessage, satisfies, usingComparator, usingComparator, usingComparisonStrategy, usingDefaultComparator, usingDefaultElementComparator, usingElementComparator, withFailMessage, withThreadDumpOnError
-
Methods inherited from class org.assertj.core.api.AbstractCollectionAssert
isUnmodifiable
-
Methods inherited from class org.assertj.core.api.AbstractIterableAssert
allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsAnyOfForProxy, containsExactly, containsExactlyElementsOf, containsExactlyForProxy, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsExactlyInAnyOrderForProxy, containsForProxy, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyForProxy, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsOnlyOnceForProxy, containsSequence, containsSequence, containsSequenceForProxy, containsSubsequence, containsSubsequence, containsSubsequenceForProxy, doesNotContain, doesNotContainAnyElementsOf, doesNotContainForProxy, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSequenceForProxy, doesNotContainSubsequence, doesNotContainSubsequence, doesNotContainSubsequenceForProxy, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, element, element, elements, endsWith, endsWith, endsWithForProxy, extracting, extracting, extracting, extracting, extracting, extracting, extractingForProxy, extractingResultOf, extractingResultOf, filteredOn, filteredOn, filteredOn, filteredOn, filteredOn, filteredOnAssertions, filteredOnAssertions, filteredOnNull, first, first, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtracting, flatExtractingForProxy, flatMap, flatMap, flatMap, flatMap, getComparatorsByType, getComparatorsForElementPropertyOrFieldTypes, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, inBinary, inHexadecimal, isEmpty, isNotEmpty, isNullOrEmpty, isSubsetOf, isSubsetOf, isSubsetOfForProxy, last, last, map, map, map, navigationDescription, newAbstractIterableAssertForProxy, noneMatch, noneSatisfy, noneSatisfy, satisfiesExactly, satisfiesExactly, satisfiesExactlyForProxy, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrderForProxy, singleElement, singleElement, size, startsWith, startsWithForProxy, usingComparatorForElementFieldsWithNames, usingComparatorForElementFieldsWithType, usingComparatorForType, usingElementComparatorIgnoringFields, usingElementComparatorOnFields, usingFieldByFieldElementComparator, usingRecursiveComparison, usingRecursiveComparison, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparator, usingRecursiveFieldByFieldElementComparatorIgnoringFields, usingRecursiveFieldByFieldElementComparatorOnFields, withAssertionState, withComparatorsForElementPropertyOrFieldNames, withComparatorsForElementPropertyOrFieldTypes, withIterables, withTypeComparators, zipSatisfy
-
Methods inherited from class org.assertj.core.api.AbstractAssert
asInstanceOf, asList, assertionError, asString, descriptionText, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, hashCode, hasSameHashCodeAs, isElementOfCustomAssert, isInstanceOfSatisfying, isNull, matches, matches, newListAssertInstance, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, withFailMessage, withRepresentation
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.assertj.core.api.Descriptable
as
-
Methods inherited from interface org.assertj.core.api.EnumerableAssert
hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, isEmpty, isNotEmpty, isNullOrEmpty
-
Methods inherited from interface org.assertj.core.api.ObjectEnumerableAssert
allMatch, allMatch, allSatisfy, allSatisfy, anyMatch, anySatisfy, anySatisfy, are, areAtLeast, areAtLeastOne, areAtMost, areExactly, areNot, contains, containsAll, containsAnyElementsOf, containsAnyOf, containsExactly, containsExactlyElementsOf, containsExactlyInAnyOrder, containsExactlyInAnyOrderElementsOf, containsNull, containsOnly, containsOnlyElementsOf, containsOnlyNulls, containsOnlyOnce, containsOnlyOnceElementsOf, containsSequence, containsSequence, containsSubsequence, containsSubsequence, doesNotContain, doesNotContainAnyElementsOf, doesNotContainNull, doesNotContainSequence, doesNotContainSequence, doesNotContainSubsequence, doesNotContainSubsequence, doesNotHaveAnyElementsOfTypes, doesNotHaveDuplicates, doNotHave, endsWith, endsWith, hasAtLeastOneElementOfType, hasExactlyElementsOfTypes, hasOnlyElementsOfType, hasOnlyElementsOfTypes, hasOnlyOneElementSatisfying, hasSameElementsAs, have, haveAtLeast, haveAtLeastOne, haveAtMost, haveExactly, isSubsetOf, isSubsetOf, noneMatch, noneSatisfy, noneSatisfy, satisfiesExactly, satisfiesExactly, satisfiesExactlyInAnyOrder, satisfiesExactlyInAnyOrder, startsWith
-
-
-
-
Field Detail
-
assertFactory
private AssertFactory<ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>> assertFactory
-
-
Constructor Detail
-
FactoryBasedNavigableListAssert
public FactoryBasedNavigableListAssert(ACTUAL actual, Class<?> selfType, AssertFactory<ELEMENT,ELEMENT_ASSERT> assertFactory)
-
-
Method Detail
-
toAssert
public ELEMENT_ASSERT toAssert(ELEMENT value, String description)
Description copied from class:AbstractIterableAssert
This method is used in navigating assertions likeAbstractIterableAssert.first()
,AbstractIterableAssert.last()
andAbstractIterableAssert.element(int)
to build the assertion for the given element navigated to.Typical implementation is returning an
ObjectAssert
but it is possible to return a more specialized assertions should you know what type of elements the iterables contain.- Specified by:
toAssert
in classAbstractIterableAssert<SELF extends FactoryBasedNavigableListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends List<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>
- Parameters:
value
- the element valuedescription
- describes the element, ex: "check first element" forAbstractIterableAssert.first()
, used in assertion description.- Returns:
- the assertion for the given element
-
newAbstractIterableAssert
protected SELF newAbstractIterableAssert(Iterable<? extends ELEMENT> iterable)
Description copied from class:AbstractIterableAssert
This methods is needed to build a new concrete instance of AbstractIterableAssert after a filtering operation is executed.If you create your own subclass of AbstractIterableAssert, simply returns an instance of it in this method.
- Specified by:
newAbstractIterableAssert
in classAbstractIterableAssert<SELF extends FactoryBasedNavigableListAssert<SELF,ACTUAL,ELEMENT,ELEMENT_ASSERT>,ACTUAL extends List<? extends ELEMENT>,ELEMENT,ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT,ELEMENT>>
- Parameters:
iterable
- the iterable used to build the concrete instance of AbstractIterableAssert- Returns:
- concrete instance of AbstractIterableAssert
-
-