Skip to content

Instantly share code, notes, and snippets.

@wkorando
Created September 8, 2018 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wkorando/26ac24fe0994411026558da865ec0c03 to your computer and use it in GitHub Desktop.
Save wkorando/26ac24fe0994411026558da865ec0c03 to your computer and use it in GitHub Desktop.
public class TestAssertJSoftAssertions {
@Test
public void testSoftAssertions() {
Person person = new Person("John", "Doe");
SoftAssertions softly = new SoftAssertions();
softly.assertThat(person.getFName()).isEqualTo("Anonymous");
softly.assertThat(person.getLName()).isEqualTo("Person");
softly.assertAll();
}
public class Person {
private String fName;
private String lName;
public Person(String fName, String lName) {
this.fName = fName;
this.lName = lName;
}
public String getFName() {
return fName;
}
public String getLName() {
return lName;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment