Skip to content

Files

Latest commit

 

History

History
23 lines (15 loc) · 640 Bytes

JUnitUnnecessarySetUp.md

File metadata and controls

23 lines (15 loc) · 640 Bytes

Pattern: JUnit - unnecessary setUp()

Issue: -

Description

Rule that checks checks for JUnit setUp() methods that contain only a call to super.setUp(). The method is then unnecessary.

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

Here is an example of a violation:

class SomeTest extends TestCase {
    void setUp() {              // violation
        super.setUp()
    }
}

Further Reading