Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 634 Bytes

UseAssertSameInsteadOfAssertTrue.md

File metadata and controls

13 lines (7 loc) · 634 Bytes

Pattern: assertTrue/assertFalse with Object#is()

Issue: -

Description

This rule detects JUnit calling assertTrue or assertFalse where the first or second parameter is an Object#is() call testing for reference equality. These assertion should be made against the assertSame or assertNotSame method instead.

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

Further Reading