Interface WebTestClient.ListBodySpec<E extends @Nullable Object>

Type Parameters:
E - the body list element type
All Superinterfaces:
WebTestClient.BodySpec<List<E>, WebTestClient.ListBodySpec<E>>
Enclosing interface:
WebTestClient

public static interface WebTestClient.ListBodySpec<E extends @Nullable Object> extends WebTestClient.BodySpec<List<E>, WebTestClient.ListBodySpec<E>>
Spec for expectations on the response body decoded to a List.
Since:
5.0
Author:
Rossen Stoyanchev, Brian Clozel, Sam Brannen, MichaƂ Rowicki
  • Method Details

    • hasSize

      WebTestClient.ListBodySpec<E> hasSize(int size)
      Assert the extracted list of values is of the given size.
      Parameters:
      size - the expected size
    • contains

      WebTestClient.ListBodySpec<E> contains(E... elements)
      Assert the extracted list of values contains the given elements.
      Parameters:
      elements - the elements to check
    • doesNotContain

      WebTestClient.ListBodySpec<E> doesNotContain(E... elements)
      Assert the extracted list of values doesn't contain the given elements.
      Parameters:
      elements - the elements to check