Recipe Name:
Use hasSizeGreaterThanOrEqualTo for size comparison of collection
Description:
Use hasSizeGreaterThanOrEqualTo for size comparison of collection
Level:
warning
Language:
- java
Tags:
- AssertJ
- framework specific
- quality
Recipe
id: scw:assertj:idiomatic:collection-hasSizeGreaterThanOrEqualTo-methodcall version: 10 metadata: name: Use hasSizeGreaterThanOrEqualTo for size comparison of collection shortDescription: Use hasSizeGreaterThanOrEqualTo for size comparison of collection level: warning language: java enabled: true tags: AssertJ;framework specific;quality search: methodcall: args: 1: value: is: methodcall: name: size label: sizeMethodCall type: reference: matches: Collection<.*> checkInheritance: true name: assertThat anyOf: - followedBy: methodcall: name: isGreaterThanOrEqualTo label: isGreaterThanOrEqualToMethodCall type: reference: matches: org.assertj.core.api.AbstractIntegerAssert<.*> checkInheritance: true - followedBy: methodcall: followedBy: methodcall: name: isGreaterThanOrEqualTo label: isGreaterThanOrEqualToMethodCall name: matches: (as|describedAs) type: reference: matches: org.assertj.core.api.AbstractIntegerAssert<.*> checkInheritance: true availableFixes: - doStaticImports: true name: Use idiomatic assertion actions: - rewrite: to: org.assertj.core.api.Assertions.assertThat({{{ arguments.0.qualifier }}}) - changeName: name: hasSizeGreaterThanOrEqualTo target: label:isGreaterThanOrEqualToMethodCall