...

/

Disabled Tests and Display Name Generator

Disabled Tests and Display Name Generator

Learn the methods and implementations of the display name generators in JUnit 5.

What are disabled tests?

We can use the annotation org.junit.jupiter.api.Disabled to mark a test class or test method as disabled. Normal tests execute and the test case either passes or fails. A disabled test never executes.

Example of a disabled test

Here's an example of a disabled test:

  • Lines 5–8: We’ve defined a normal test that executes and passes because the condition is True.

  • Lines 10–14: ...