A JUnit 5 test method is public, which JUnit 5 does not need

tx0/java:public-jupiter-teststrictwarningmaintainability/testsdepth faststyle

What it finds

JUnit 5 finds test methods that are package-private, so public on them only widens their visibility for no reader.

Reported is a public test method in a file that imports org.junit.jupiter. The fix removes public.

From the rule's source, public_jupiter_test.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:public-jupiter-test" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:public-jupiter-test] reason="..."

tx0 explain tx0/java:public-jupiter-test shows the same in the terminal. Found a false positive? Report it.