extracting
Extracts a value of from each item in the array, allowing you to assert on a list of those values.
assertThat(people)
.extracting(Person::name)
.containsExactly("Sue", "Bob")
Extracts two values of from each item in the array, allowing you to assert on a list of paris of those values.
assertThat(people)
.extracting(Person::name, Person::age)
.containsExactly("Sue" to 20, "Bob" to 22)
Extracts three values from each item in the array, allowing you to assert on a list of triples of those values.
assertThat(people)
.extracting(Person::name, Person::age, Person::address)
.contains(Triple("Sue", 20, "123 Street"), Triple("Bob", 22, "456 Street")
Extracts a value of from each item in the iterable, allowing you to assert on a list of those values.
assertThat(people)
.extracting(Person::name)
.containsOnly("Sue", "Bob")
Extracts two values of from each item in the iterable, allowing you to assert on a list of paris of those values.
assertThat(people)
.extracting(Person::name, Person::age)
.containsOnly("Sue" to 20, "Bob" to 22)
Extracts three values from each item in the iterable, allowing you to assert on a list of triples of those values.
assertThat(people)
.extracting(Person::name, Person::age, Person::address)
.contains(Triple("Sue", 20, "123 Street"), Triple("Bob", 22, "456 Street")
Extracts a value of from each item in the sequence, allowing you to assert on a list of those values.
assertThat(people)
.extracting(Person::name)
.containsExactly("Sue", "Bob")
Extracts two values of from each item in the sequence, allowing you to assert on a list of paris of those values.
assertThat(people)
.extracting(Person::name, Person::age)
.containsExactly("Sue" to 20, "Bob" to 22)
Extracts three values from each item in the sequence, allowing you to assert on a list of triples of those values.
assertThat(people)
.extracting(Person::name, Person::age, Person::address)
.contains(Triple("Sue", 20, "123 Street"), Triple("Bob", 22, "456 Street")