Option B uses a descriptive, behavior-driven style that clearly states what the test checks. It is readable and follows common naming conventions.
Options B, C, and D are less descriptive or less clear in intent.
import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; public class LoginTests { @Test public void login() { assertTrue(true); } public void testLoginSuccess() { assertTrue(true); } }
JUnit 5 runs methods annotated with @Test. The method 'login' has @Test, so it runs and passes.
'testLoginSuccess' lacks @Test annotation, so it is ignored.
Option A clearly states the expected behavior in a readable way, starting with 'should'.
Other options are less readable or less consistent with common naming conventions.
JUnit 5 requires the @Test annotation to identify test methods regardless of their name.
Method name or visibility does not prevent running if @Test is present.
Assertions do not cause skipping; they cause failures if incorrect.
Descriptive test names make reports easier to understand and debug.
Reports include method names, so clear names help identify problems quickly.
Long names do not affect execution speed.