Instantly share code, notes, and snippets.

@cajar1988 /test3.java Secret
Last active Nov 1, 2015

Embed
What would you like to do?
//given
PersonService personService = new PersonService();
//when
Person firstPerson = personService.fetchFirst();
//then
//Junit
assertTrue(firstPerson.getFirstName().contains("Adam"));
assertTrue(firstPerson.getFirstName().startsWith("A"));
assertTrue(firstPerson.getFirstName().endsWith("m"));
assertEquals(7, firstPerson.getFirstName().length());
//AssertJ
assertThat(firstPerson.getFirstName())
.contains("Adam")
.startsWith("A")
.endsWith("m")
.hasSize(7);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment