I need to create custom assertion for list items.
For example, I have ArrayList in which there is an Address Object, now I need to create a custom assertion to check anySatisfy
Assertions.assertThat(results.result).anySatisfy(p->{
assertThat(p.getAddress().getCity()).withFailMessage("expected city: "+ "Caseros1").isEqualTo("Caseros1");
assertThat(p.getAddress().getCountryName()).isEqualTo("Argentina");
});
Any suggestion. Thanks!