Instantly share code, notes, and snippets.

@cajar1988 /test2.java Secret
Last active Oct 30, 2015

Embed
What would you like to do?
//given
PersonService personService = new PersonService();
//when
List<Person> persons = personService.fetchFromCity("Lublin");
//then
//pure JUnit
assertTrue(persons.stream()
.filter(person -> !person.getAddress().getCity().equals("Lublin")).count() == 0);
//AssertJ
assertThat(persons)
.filteredOn(person -> !person.getAddress().getCity().equals("Lublin"))
.isEmpty();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment