JUnit Annotations

  • @Test - Marks a test method. Will be run by JUnit
  • @BeforeEach/@BeforeAll - Marks code that should run before each test or before all
  • @AfterEach/@AfterAll - Marks code that should run before each test or before all
  • @Disabled - Useful for temporarily stopping a test from running
  • @Tag - Useful for organizing tests and running subsets
  • Many more

14 / 21