Skip to content

[java] Merge Junit assertion simplification rules #2908

@oowekyala

Description

@oowekyala

The following rules:

  • bestpractices.xml
    • UseAssertEqualsInsteadOfAssertTrue
    • UseAssertNullInsteadOfAssertTrue
    • UseAssertSameInsteadOfAssertTrue
    • UseAssertTrueInsteadOfAssertEquals
  • design.xml/SimplifyBooleanAssertion

could be merged together into a new SimplifiableTestAssertion rule. This would

  • make them simpler to reference, you probably want all of them, and SimplifyBooleanAssertion is alone in design.xml
  • simplify the implementation (currently some logic is duplicated between rules)

Category would likely be bestpractices.xml

Motivation for the rule would be readability + better error messages

Additional context
#2899 reimplements many of those, but not SimplifyBooleanAssertion. We can merge them later

Metadata

Metadata

Assignees

Labels

an:enhancementAn improvement on existing features / rules

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions