Package org.assertj.core.api
Interface IndexedObjectEnumerableAssert<SELF extends IndexedObjectEnumerableAssert<SELF,ELEMENT>,ELEMENT>
- Type Parameters:
SELF
- the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.ELEMENT
- the type of elements of the "actual" value.
- All Superinterfaces:
EnumerableAssert<SELF,
,ELEMENT> ObjectEnumerableAssert<SELF,
ELEMENT>
- All Known Implementing Classes:
AbstractListAssert
,AbstractObjectArrayAssert
,AtomicReferenceArrayAssert
,ClassBasedNavigableListAssert
,FactoryBasedNavigableListAssert
,ListAssert
,ObjectArrayAssert
public interface IndexedObjectEnumerableAssert<SELF extends IndexedObjectEnumerableAssert<SELF,ELEMENT>,ELEMENT>
extends ObjectEnumerableAssert<SELF,ELEMENT>
Assertions methods applicable to indexed groups of objects (e.g. arrays or lists.)
- Author:
- Alex Ruiz, Mikhail Mazursky
-
Method Summary
Methods inherited from interface org.assertj.core.api.EnumerableAssert
hasSameSizeAs, hasSameSizeAs, hasSize, hasSizeBetween, hasSizeGreaterThan, hasSizeGreaterThanOrEqualTo, hasSizeLessThan, hasSizeLessThanOrEqualTo, isEmpty, isNotEmpty, isNullOrEmpty, usingDefaultElementComparator, usingElementComparator
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, satisfiesOnlyOnce, satisfiesOnlyOnce, startsWith
-
Method Details
-
contains
Verifies that the actual group contains the given object at the given index.Example:
List<Ring> elvesRings = newArrayList(vilya, nenya, narya); // assertions will pass assertThat(elvesRings).contains(vilya, atIndex(0)); assertThat(elvesRings).contains(nenya, atIndex(1)); assertThat(elvesRings).contains(narya, atIndex(2)); // assertions will fail assertThat(elvesRings).contains(vilya, atIndex(1)); assertThat(elvesRings).contains(nenya, atIndex(2)); assertThat(elvesRings).contains(narya, atIndex(0));
- Parameters:
value
- the object to look for.index
- the index where the object should be stored in the actual group.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actual group isnull
or empty.NullPointerException
- if the givenIndex
isnull
.IndexOutOfBoundsException
- if the value of the givenIndex
is equal to or greater than the size of the actual group.AssertionError
- if the actual group does not contain the given object at the given index.
-
doesNotContain
Verifies that the actual group does not contain the given object at the given index.Example:
List<Ring> elvesRings = newArrayList(vilya, nenya, narya); // assertions will pass assertThat(elvesRings).contains(vilya, atIndex(1)); assertThat(elvesRings).contains(nenya, atIndex(2)); assertThat(elvesRings).contains(narya, atIndex(0)); // assertions will fail assertThat(elvesRings).contains(vilya, atIndex(0)); assertThat(elvesRings).contains(nenya, atIndex(1)); assertThat(elvesRings).contains(narya, atIndex(2));
- Parameters:
value
- the object to look for.index
- the index where the object should not be stored in the actual group.- Returns:
- this assertion object.
- Throws:
AssertionError
- if the actual group isnull
.NullPointerException
- if the givenIndex
isnull
.AssertionError
- if the actual group contains the given object at the given index.
-