Recipe Name:
JUnit 4: assertEquals suspicious order of arguments (with message)
Description:
Suspicious argument values for 'expected' and 'actual'
Level:
warning
Language:
- java
Tags:
- testing
- framework specific
- JUnit 4
- quality
Recipe
id: scw:java:junit4:assertEquals-suspicious-order(with-message) version: 10 metadata: name: 'JUnit 4: assertEquals suspicious order of arguments (with message)' shortDescription: Suspicious argument values for 'expected' and 'actual' level: warning language: java enabled: true tags: testing;framework specific;JUnit 4;quality search: methodcall: args: 2: value: not: is: literal: {} 3: value: is: literal: {} argCount: 3 name: assertEquals type: org.junit.Assert availableFixes: - name: Swap arguments 'actual' and 'expected' actions: - rewrite: to: assertEquals({{{arguments.0}}}, {{{arguments.2}}}, {{{arguments.1}}}) target: self