From f6a584e833f650530fd6f826f423c9890d24d9e9 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 17 Jun 2021 18:23:09 +0200 Subject: [PATCH] Document best practices for test method and test class visibility This is a follow up to 419ddb12f13049692949f0f12d50e8f38cf43cba. Closes #2626 --- documentation/src/docs/asciidoc/user-guide/writing-tests.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc index c54b0d8e1e11..f466fe86fea2 100644 --- a/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc +++ b/documentation/src/docs/asciidoc/user-guide/writing-tests.adoc @@ -124,7 +124,9 @@ they must _not_ be `private`. It is generally recommended to omit the `public` modifier for test classes, test methods, and lifecycle methods unless there is a technical reason for doing so – for example, when -a test class is extended by a test class in another package. +a test class is extended by a test class in another package. Another technical reason for +making classes and methods `public` is to simplify testing on the module path when using +the Java Module System. ==== The following test class demonstrates the use of `@Test` methods and all supported