Recipe Name:
Use AssertJ's isNotSameAs()
Description:
Can be replaced with AssertJ style assertions
Level:
warning
Language:
  • java
Tags:
  • AssertJ
  • TestNG
Recipe
id: scw:assertj:junit-assert-not-same
version: 10
metadata:
  name: Use AssertJ's isNotSameAs()
  shortDescription: Can be replaced with AssertJ style assertions
  level: warning
  language: java
  enabled: true
  tags: AssertJ; TestNG
search:
  methodcall:
    argCount: 2
    name: assertNotSame
    anyOf:
    - type: org.junit.Assert
    - type: junit.framework.TestCase
    - type: junit.framework.Assert
    - type: org.junit.jupiter.api.Assertions
    - type: org.testng.AssertJUnit
availableFixes:
- doStaticImports: true
  name: Change to assertThat(actual).isNotSameAs(expected)
  actions:
  - rewrite:
      to: org.assertj.core.api.Assertions.assertThat({{{ arguments.1 }}}).isNotSameAs({{{ arguments.0 }}})