Cookbook Name:
Standardisation on AssertJ for unit testing
Description:
Recipes to standardise on the AssertJ framework including idiomatic assertions and migrations from other frameworks.
Owner:
Secure Code Warrior
Number of Recipes:
108
Recipe Name Description Language Level Tags
AssertJ/From FEST Assert
FEST Assertion method removed in AssertJ FEST Assertion method removed in AssertJ java warning AssertJframework specific
Use AssertJ rather than FEST assertions Use AssertJ rather than FEST assertions java warning AssertJframework specific
AssertJ/From Hamcrest
Use AssertJ's contains() instead of containsInRelativeOrder Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's contains() instead of containsString() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's contains() instead of hasItem() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's contains() instead of hasItems() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's containsExactly() instead of contains Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's containsExactlyInAnyOrder() instead of containsInAnyOrder Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's containsIgnoringCase() instead of containsStringIgnoringCase() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's endsWith() instead of Hamcrest's endsWith() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's hasSize() instead of hasLength() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's hasSize() instead of hasSize/iterableWithSize/arrayWithSize/aMapWithSize Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's hasSize() instead of is(hasSize/iterableWithSize/arrayWithSize/aMapWithSize) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isBlank() instead of blankString()/blankOrNullString() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isBlank() instead of is(blankString())/is(blankOrNullString()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEmpty() instead of empty/emptyCollection/emptyIterable/emptyString Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEmpty() instead of is(empty/emptyCollection/emptyIterable/emptyString) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualByComparingTo() instead of comparesEqualTo() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualByComparingTo() instead of is(comparesEqualTo()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualTo() instead of equalTo/is Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualTo() instead of is(equalTo()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualToIgnoringCase() instead of equalToIgnoringCase() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualToIgnoringCase() instead of is(equalToIgnoringCase()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualToNormalizingWhitespace() instead of equalToCompressingWhiteSpace() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isEqualToNormalizingWhitespace() instead of is(equalToCompressingWhiteSpace()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isGreaterThan() instead of greaterThan() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isGreaterThan() instead of is(greaterThan()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isGreaterThanOrEqualTo() instead of greaterThanOrEqualTo() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isGreaterThanOrEqualTo() instead of is(greaterThanOrEqualTo()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isLessThan() instead of is(lessThan()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isLessThan() instead of lessThan() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isLessThanOrEqualTo() instead of is(lessThanOrEqualTo()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isLessThanOrEqualTo() instead of lessThanOrEqualTo() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNotNull() instead of is(notNullValue()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNotNull() instead of notNullValue() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNull() instead of is(nullValue()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNull() instead of nullValue() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNullOrEmpty() instead of emptyOrNullString() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's isNullOrEmpty() instead of is(emptyOrNullString()) Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's matches() instead of matchesRegex()/matchesPattern() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
Use AssertJ's startsWith() instead of Hamcrest's startsWith() Can be replaced with AssertJ style assertions java warning AssertJHamcrest
AssertJ/From JUnit
Use AssertJ "not thrown" assertions Use AssertJ "not thrown" assertions java warning AssertJ
Use AssertJ ThrowingCallable assertions Use AssertJ ThrowingCallable assertions java warning AssertJ
Use AssertJ ThrowingCallable assertions (JUnit v4) Use AssertJ ThrowingCallable assertions (JUnit v4) java warning AssertJ
Use AssertJ's fail() Use AssertJ's fail() java warning AssertJTestNG
Use AssertJ's fail() (Supplier ref -> invocation) Use AssertJ's fail() (Supplier ref -> invocation) java warning AssertJframework specific
Use AssertJ's fail() (method ref -> invocation) Use AssertJ's fail() (method ref -> invocation) java warning AssertJframework specific
Use AssertJ's fail() (unwrapping message lambda) Use AssertJ's fail() (unwrapping message lambda) java warning AssertJframework specific
Use AssertJ's fail() (with cause exception) Use AssertJ's fail() (with cause exception) java warning AssertJframework specific
Use AssertJ's isEqualTo() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isEqualTo() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isEqualTo() instead of assertArrayEquals Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isEqualTo() instead of assertArrayEquals (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isFalse() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isFalse() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotNull() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotNull() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotSameAs() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotSameAs() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNull() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNull() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isSameAs() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isSameAs() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isTrue() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isTrue() (with message) Can be replaced with AssertJ style assertions java warning AssertJTestNG
AssertJ/From TestNG
Use AssertJ ThrowingCallable assertions Use AssertJ ThrowingCallable assertions java warning AssertJTestNG
Use AssertJ's fail() Use AssertJ's fail() java warning AssertJTestNG
Use AssertJ's isEqualTo() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isFalse() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotEqualTo() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotNull() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNotSameAs() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isNull() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isSameAs() Can be replaced with AssertJ style assertions java warning AssertJTestNG
Use AssertJ's isTrue() Can be replaced with AssertJ style assertions java warning AssertJTestNG
AssertJ/Idiomatic
Use assertThat(Specific)Exception Use assertThat(Specific)Exception java warning AssertJframework specificquality
Use contains instead of contains isTrue Use contains instead of contains isTrue java warning AssertJframework specificquality
Use hasSameSizeAs for comparing Collection sizes Use hasSameSizeAs for comparing Collection sizes java warning AssertJframework specificquality
Use hasSameSizeAs for comparing to another collection's size Use hasSameSizeAs for comparing to another collection's size java warning AssertJframework specificquality
Use hasSize for checking Collection size Use hasSize for checking Collection size java warning AssertJframework specificquality
Use hasSizeGreaterThan for size comparison of collection Use hasSizeGreaterThan for size comparison of collection java warning AssertJframework specificquality
Use hasSizeGreaterThan for size comparison of collection Use hasSizeGreaterThan for size comparison of collection java warning AssertJframework specificquality
Use hasSizeGreaterThanOrEqualTo for size comparison of collection Use hasSizeGreaterThanOrEqualTo for size comparison of collection java warning AssertJframework specificquality
Use hasSizeGreaterThanOrEqualTo for size comparison of collection Use hasSizeGreaterThanOrEqualTo for size comparison of collection java warning AssertJframework specificquality
Use hasSizeLessThan for size comparison of collection Use hasSizeLessThan for size comparison of collection java warning AssertJframework specificquality
Use hasSizeLessThan for size comparison of collection Use hasSizeLessThan for size comparison of collection java warning AssertJframework specificquality
Use hasSizeLessThanOrEqualTo for size comparison of collection Use hasSizeLessThanOrEqualTo for size comparison of collection java warning AssertJframework specificquality
Use hasSizeLessThanOrEqualTo for size comparison of collection Use hasSizeLessThanOrEqualTo for size comparison of collection java warning AssertJframework specificquality
Use isEmpty for checking empty Collection Use isEmpty for checking empty Collection java warning AssertJframework specificquality
Use isEmpty for checking empty Collection Use isEmpty for checking empty Collection java warning AssertJframework specificquality
Use isEmpty for checking for collection with no elements Use isEmpty for checking for collection with no elements java warning AssertJframework specificquality
Use isEmpty for checking for collection with no elements Use isEmpty for checking for collection with no elements java warning AssertJframework specificquality
Use isEqualTo instead of == isTrue Use isEqualTo instead of == isTrue java warning AssertJframework specificquality
Use isEqualTo instead of equals isTrue Use isEqualTo instead of equals isTrue java warning AssertJframework specificquality
Use isFalse rather than isEqualTo(false) Use isFalse rather than isEqualTo(false) java warning AssertJframework specificquality
Use isNotEmpty for checking for collection with no elements Use isNotEmpty for checking for collection with no elements java warning AssertJframework specificquality
Use isNotEmpty for checking for collection with no elements Use isNotEmpty for checking for collection with no elements java warning AssertJframework specificquality
Use isNotEmpty for checking for collection with some elements Use isNotEmpty for checking for collection with some elements java warning AssertJframework specificquality
Use isNotEmpty for checking non-empty Collection Use isNotEmpty for checking non-empty Collection java warning AssertJframework specificquality
Use isNotEqualTo instead of != isTrue Use isNotEqualTo instead of != isTrue java warning AssertJframework specificquality
Use isNotEqualTo instead of !equals isTrue Use isNotEqualTo instead of !equals isTrue java warning AssertJframework specificquality
Use isNotEqualTo instead of == isFalse Use isNotEqualTo instead of == isFalse java warning AssertJframework specificquality
Use isNotEqualTo instead of equals isFalse Use isNotEqualTo instead of equals isFalse java warning AssertJframework specificquality
Use isNotNull rather than isNotEqualTo(null) Use isNotNull rather than isNotEqualTo(null) java warning AssertJframework specificquality
Use isNull rather than isEqualTo(null) Use isNull rather than isEqualTo(null) java warning AssertJframework specificquality
Use isTrue rather than isEqualTo(true) Use isTrue rather than isEqualTo(true) java warning AssertJframework specificquality
Use matches(pattern) instead of matches(Pattern.compile(pattern)) Use matches(pattern) instead of matches(Pattern.compile(pattern)) java warning AssertJframework specificquality
assertThatThrownBy won't use description if the code doesn't throw assertThatThrownBy won't use description if the code doesn't throw java error AssertJframework specificquality
Markdown badge: