@CompileStatic abstract class PageablePayloadAssertion<SELF extends PageablePayloadAssertion<SELF, PAGE_ITEM_ASSERTION>, PAGE_ITEM_ASSERTION extends PageItemAssertionable> extends Object
Parent class for each assertion class that wants to check a map representing pageable payload returned from some operation.
The general structure of the response map corresponds to[ metadata:[ // metadata's keys and values. Not relevant in the context of this class. They are asserted by MetaDataAssertion. ], payload:[ pageInfo:[ // pageInfo's keys and values assertable by PageInfoAssertion ], pageContent: [ // pageContent is a list of maps [ // first pageContent item's key and values // second pageContent item's key and values // ... ] ] ] ]This class is defines general structures and rules (implemented as methods) for asserting
payload.pageInfo
and payload.pageContent
. While payload.pageInfo
asserting is
delegated to PageInfoAssertion instances, individual instances of payload.pageContent
are asserted by PAGE_ITEM_ASSERTION
type.
Therefore, any concrete class extending this one, has to provide PAGE_ITEM_ASSERTION
type via generic declaration, where PAGE_ITEM_ASSERTION
instances are then responsible
for asserting the details of each item in payload.pageContent
.
In addition, PAGE_ITEM_ASSERTION
types have to implement PageItemAssertionable to make it possible for instances of this class to invoke their methods when appropriate. SELF
- The type of "this
" instance representing the instance of a subclass in the context of this abstract superclass.PAGE_ITEM_ASSERTION
- The type of class capable to assert individual item of pageContent
list.Type Params | Return Type | Name and description |
---|---|---|
|
static void |
assertResponse(Map responseMap) |
|
abstract PAGE_ITEM_ASSERTION |
getPageItemAssertionInstance(Map pageItemMap) |
|
SELF |
hasPageContentSizeGreaterThanOrEqual(Long comparablePageContentSize) |
|
SELF |
hasPageContentWithAllItemsThat(Closure aClosure) |
|
SELF |
hasPageContentWithAnyItemThat(Closure aClosure) |
|
SELF |
hasPageContentWithFirstItemThat(Closure aClosure) |
|
SELF |
hasPageContentWithItemAtIndexThat(Integer anIndex, Closure aClosure) |
|
SELF |
hasPageContentWithLastItemThat(Closure aClosure) |
|
SELF |
hasPageInfoOfFirstPageWithDefaults() |
|
SELF |
hasPageInfoThat(Closure aClosure) |
|
SELF |
isEmpty() |
|
SELF |
isSuccessful() |
|
SELF |
isSuccessfulAndEmpty() |