assertAll

assertAll groups several assertions and runs them all, reporting every failure instead of stopping at the first one. It is useful for verifying several properties of the same object in a single test.

Example

assertAll(
    () -> assertEquals("Ada", p.nom()),
    () -> assertEquals(36, p.age())
);

Related concepts

The whole glossary