Recipe Name:
Use isFalse rather than isEqualTo(false)
Description:
Use isFalse rather than isEqualTo(false)
Level:
warning
Language:
  • java
Tags:
  • AssertJ
  • framework specific
  • quality
Recipe
id: scw:assertj:idiomatic:isFalse
version: 10
metadata:
  name: Use isFalse rather than isEqualTo(false)
  shortDescription: Use isFalse rather than isEqualTo(false)
  level: warning
  language: java
  enabled: true
  tags: AssertJ;framework specific;quality
search:
  methodcall:
    args:
      1:
        anyOf:
        - type: java.lang.Boolean
          value:
            anyOf:
            - stringified: Boolean.FALSE
            - stringified: "FALSE"
        - type: boolean
          value:
            stringified: "false"
    name: isEqualTo
    "on":
      methodcall:
        anyOf:
        - name:
            matches: (as|describedAs)
          "on":
            methodcall:
              name: assertThat
              type: org.assertj.core.api.Assertions
        - name: assertThat
          type: org.assertj.core.api.Assertions
availableFixes:
- name: Use idiomatic assertion
  actions:
  - changeName:
      name: isFalse
  - modifyArguments:
      remove:
      - 1