Skip to content

Files

Latest commit

 

History

History
25 lines (15 loc) · 816 Bytes

JUnitLostTest.md

File metadata and controls

25 lines (15 loc) · 816 Bytes

Pattern: JUnit - lost test

Issue: -

Description

This rule checks for classes that import JUnit 4 classes and contain a public, instance, void, no-arg method named test* that is not annotated with the JUnit 4 @Test annotation.

Note: This rule should be disabled for Grails 2.x projects, since the Grails test framework can use AST Transformations to automatically annotate test methods.

This rule sets the default value of the applyToClassNames property to only match class names ending in 'Test', 'Tests' or 'TestCase'.

Example of violations:

import org.junit.Test

class SomeTestCase {
    void testMe() { }           // missing @Test annotation
}

Further Reading