Test Method Naming (ARCH4008)
هذا المحتوى غير متوفر بلغتك بعد.
Key java.naming.test-name-convention · Severity info · Category naming
Test methods should follow the test framework’s discovery/naming convention so they are picked up and read consistently.
Incorrect
Section titled “Incorrect”class OrderServiceTest { @Test void t1() { // meaningless name assertEquals(2, calc(1, 1)); }}Correct
Section titled “Correct”class OrderServiceTest { @Test void calc_addsTwoNumbers_returnsSum() { assertEquals(2, calc(1, 1)); }}Name test methods with a descriptive convention such as “method_scenario_expected”.