use of org.assertj.core.api.BDDSoftAssertions in project assertj-core by joel-costigliola.
the class BDDSoftAssertionsLineNumberTest method should_print_line_numbers_of_failed_assertions.
@Test
public void should_print_line_numbers_of_failed_assertions() {
BDDSoftAssertions softly = new BDDSoftAssertions();
try {
softly.then(1).isLessThan(0).isLessThan(1);
softly.assertAll();
fail("Should not reach here");
} catch (SoftAssertionError e) {
assertThat(e).hasMessageContaining(format("1) %n" + "Expecting:%n" + " <1>%n" + "to be less than:%n" + " <0> %n" + "at BDDSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions(BDDSoftAssertionsLineNumberTest.java:34)%n" + "2) %n" + "Expecting:%n" + " <1>%n" + "to be less than:%n" + " <1> %n" + "at BDDSoftAssertionsLineNumberTest.should_print_line_numbers_of_failed_assertions(BDDSoftAssertionsLineNumberTest.java:35)"));
}
}
Aggregations