The resources page has been updated to include a link to the JUnit5 User Guide—specifically, to the “Writing Tests” section. This section has a number of good examples, and is quite comprehensive. Actually, it can be a bit overwhelming; thus, I recommend focusing on these annotations for the tests and supporting methods:
@Test-
Annotates a basic test method. Such a method takes no parameters.
@ParameterizedTest-
Annotates a parameterized test method, where the parameter values represent a single test case; at runtime, JUnit5 uses a specified source of arguments to invoke the parameterized test method once for each test case.
@DisplayName-
Can be used with any test method to provide a more user-readable name for the test in the output.
@BeforeEach-
Indicates a method that will be invoked before each test method invocation in the class; thus, such a method can be used to execute any setup logic required by all of the tests in the class.
@AfterEach-
Indicates a method that will be invoked after each test method invocation in the class; thus, such a method can be used to execute any cleanup logic required by all of the tests in the class.
@BeforeAll-
A
staticmethod with this annotation will be invoked just once, before any of the test methods in the class; it can be used to initialize anystaticfields needed by the test methods. @AfterAll-
A
staticmethod with this annotation will be invoked just once, after all of the test methods in the class have executed; it can be used to cleanup anystaticfields or other shared state used by the test methods.
In the “Writing Tests: Parameterized Tests” sub-section, I recommend paying particular attention to the @MethodSource and @CsvFileSource entries.