Skip to content

Instantly share code, notes, and snippets.

@cajar1988
Last active November 1, 2015 20:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cajar1988/45ec52602188fa6228de to your computer and use it in GitHub Desktop.
//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