Class ItemsAssert<T extends it.tidalwave.util.As>

java.lang.Object
it.tidalwave.ui.test.ItemsAssert<T>

@API(status=EXPERIMENTAL) public class ItemsAssert<T extends it.tidalwave.util.As> extends Object
Assertions for items of Composite and Aggregate.
Since:
3.0-ALPHA-3
Author:
Fabrizio Giudici
  • Field Details

    • itemType

      @Nonnull protected final Class<T extends it.tidalwave.util.As> itemType
      The type of items.
    • items

      @Nonnull protected final List<T extends it.tidalwave.util.As> items
      The items.
    • nextItemSatisfyingCalled

      protected final boolean nextItemSatisfyingCalled
      Whether withNextItemSatisfying(ThrowingConsumer) has been already called in the current chain.
  • Constructor Details

    • ItemsAssert

      public ItemsAssert()
  • Method Details

    • of

      @Nonnull protected static <U extends it.tidalwave.util.As> ItemsAssert<U> of(@Nonnull Class<U> itemType, @Nonnull List<U> items)
    • withEachItem

      @Nonnull public ItemsAssert<T> withEachItem(@Nonnull org.mockito.ThrowingConsumer<T> consumer)
      Enumerates all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls to withNextItemSatisfying(ThrowingConsumer), but only before them.
      Parameters:
      consumer - the consumer of children
      Returns:
      an object for fluent further assertions
    • withEachItemSatisfying

      @Nonnull public ItemsAssert<T> withEachItemSatisfying(@Nonnull org.mockito.ThrowingConsumer<AsAssert<?>> consumer)
      Enumerates all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls to withNextItemSatisfying(ThrowingConsumer), but only before them.
      Parameters:
      consumer - the consumer of children
      Returns:
      an object for fluent further assertions
    • withAll

      @Nonnull public ItemsAssert<T> withAll(@Nonnull Consumer<T[]> consumer)
      Provides all children of the current object so assertions can be enforced on them. This method can be used in a chain that includes one or multiple calls to withNextItemSatisfying(ThrowingConsumer), but only before them.
      Parameters:
      consumer - the consumer of children
      Returns:
      an object for fluent further assertions
    • withNextItemSatisfying

      @Nonnull public ItemsAssert<T> withNextItemSatisfying(@Nonnull org.mockito.ThrowingConsumer<AsAssert<?>> consumer)
      Provides the next child of this object so assertions can be enforced on them. Further chained calls of this method will provide further children.
      Parameters:
      consumer - the consumer of the child
      Returns:
      an object for fluent further assertions