In JUnit 5, what is required for a method to be picked up and run as a test by the test runner?
- aThe method name must start with the word
test, since JUnit 5 still relies on naming conventions like JUnit 3 did - bThe method must be annotated with
@Test(or a related test-registering annotation such as@ParameterizedTest)✓ - cThe method must be declared
public staticso the runner can invoke it without creating a test instance - dThe class must implement a
Testableinterface that exposes the method to the JUnit 5 discovery engine
Explanation:JUnit 5 discovers tests purely through annotations, not naming conventions. A method annotated with
@Test (or @ParameterizedTest, @RepeatedTest, etc.) is registered as a test. There is no required method name prefix, no public static requirement (instance methods are used, package-private is enough), and no Testable interface to implement.