Recipe Name:
Use isNull rather than isEqualTo(null)
Description:
Use isNull rather than isEqualTo(null)
Level:
warning
Language:
  • java
Tags:
  • AssertJ
  • framework specific
  • quality
Recipe
id: scw:assertj:idiomatic:isNull
version: 10
metadata:
  name: Use isNull rather than isEqualTo(null)
  shortDescription: Use isNull rather than isEqualTo(null)
  level: warning
  language: java
  enabled: true
  tags: AssertJ;framework specific;quality
search:
  methodcall:
    args:
      1:
        value:
          stringified: "null"
          label: nullArg
    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: isNull
  - remove:
      target: label:nullArg