Interface GraphQlTester.EntityList<E extends @Nullable Object>
- Type Parameters:
E- the type of elements in the list
- All Superinterfaces:
GraphQlTester.Entity<List<E>, GraphQlTester.EntityList<E>>,GraphQlTester.Traversable
- Enclosing interface:
GraphQlTester
public static interface GraphQlTester.EntityList<E extends @Nullable Object>
extends GraphQlTester.Entity<List<E>, GraphQlTester.EntityList<E>>
Contains a List of decoded entities and provides options to assert them.
- Since:
- 1.0.0
- Author:
- Rossen Stoyanchev, Brian Clozel
-
Method Summary
Modifier and TypeMethodDescriptionVerify the list contains the given values, in any order.containsExactly(E... values) Verify that the list contains exactly the given values and nothing else, in the same order.doesNotContain(E... values) Verify the list does not contain the given values.hasSize(int size) Verify the number of values in the list.hasSizeGreaterThan(int size) Verify the list has more than the specified number of values.hasSizeLessThan(int size) Verify the list has fewer than the number of values.Verify the list has a single element and return anEntityspec for it.Methods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Entity
get, isEqualTo, isNotEqualTo, isNotSameAs, isSameAs, matches, satisfiesMethods inherited from interface org.springframework.graphql.test.tester.GraphQlTester.Traversable
path, path
-
Method Details
-
contains
Verify the list contains the given values, in any order.- Parameters:
values- values that are expected- Returns:
- the
EntityListspec for further assertions
-
doesNotContain
Verify the list does not contain the given values.- Parameters:
values- the values that are not expected- Returns:
- the
EntityListspec for further assertions
-
containsExactly
Verify that the list contains exactly the given values and nothing else, in the same order.- Parameters:
values- the expected values- Returns:
- the
EntityListspec for further assertions
-
hasSize
Verify the number of values in the list.- Parameters:
size- the expected size- Returns:
- the
EntityListspec for further assertions
-
hasSizeLessThan
Verify the list has fewer than the number of values.- Parameters:
size- the number to compare the actual size to- Returns:
- the
EntityListspec for further assertions
-
hasSizeGreaterThan
Verify the list has more than the specified number of values.- Parameters:
size- the number to compare the actual size to- Returns:
- the
EntityListspec for further assertions
-
singleElement
GraphQlTester.Entity<E,?> singleElement()Verify the list has a single element and return anEntityspec for it.This is a convenience method that combines
hasSize(1)with navigating to the first element in the list.- Returns:
- an
Entityspec for the single element that allows further assertions
-