Can AssertJ filter elements for assertion? #3107
Answered
by
joel-costigliola
1506085843
asked this question in
Q&A
-
`
` It's not working properly.Expected size: 1 but was: 3 in. I want to check if the number of Tom is 1 . I was wondering if there is a way to filter List elements and assert,like below: |
Beta Was this translation helpful? Give feedback.
Answered by
joel-costigliola
Mar 24, 2023
Replies: 1 comment
Answer selected by
1506085843
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have you tried https://www.javadoc.io/doc/org.assertj/assertj-core/latest/org/assertj/core/api/AbstractIterableAssert.html#filteredOn(java.util.function.Predicate)?