Migrate Google Truth code to AssertJ
MSALConvert Google Truth assertions, subject types and their methods to AssertJ equivalents.
org. openrewrite. java. testing. truth. TruthCodeToAssertJmod run . --recipe= org. openrewrite. java. testing. truth. TruthCodeToAssertJInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Convert Truth
assert_()to AssertJ - Convert Truth
assertWithMessageto AssertJ - Convert Truth Throwable assertions to AssertJ
- Migrate Truth custom subjects to AssertJ
- Change method name
com.google.common.truth..* hasLength(int)tohasSize - Change method name
com.google.common.truth.StringSubject containsMatch(..)tomatches - Change method name
com.google.common.truth.StringSubject doesNotContainMatch(..)todoesNotMatch - Change type
StringSubjecttoAbstractStringAssert - Change method name
com.google.common.truth.ComparableSubject isAtLeast(..)toisGreaterThanOrEqualTo - Change method name
com.google.common.truth.ComparableSubject isAtMost(..)toisLessThanOrEqualTo - Change type
ComparableSubjecttoAbstractComparableAssert - Change method name
com.google.common.truth.Subject isSameInstanceAs(..)toisSameAs - Change method name
com.google.common.truth.Subject isNotSameInstanceAs(..)toisNotSameAs - Change type
SubjecttoAbstractObjectAssert - Change method name
com.google.common.truth.IterableSubject containsExactlyElementsIn(..)tocontainsExactlyElementsOf - Change method name
com.google.common.truth.IterableSubject containsAnyIn(..)tocontainsAnyElementsOf - Change method name
com.google.common.truth.IterableSubject containsNoneIn(..)todoesNotContainAnyElementsOf - Change method name
com.google.common.truth.IterableSubject containsAllIn(..)tocontainsAll - Change method name
com.google.common.truth.IterableSubject containsAllOf(..)tocontains - Change method name
com.google.common.truth.IterableSubject containsNoneOf(..)todoesNotContain - Change type
IterableSubjecttoAbstractIterableAssert - Change method name
com.google.common.truth.OptionalSubject hasValue(..)tocontains - Change type
OptionalSubjecttoAbstractOptionalAssert - Change type
GuavaOptionalSubjecttoAbstractOptionalAssert - Change method name
org.assertj.core.api.AbstractMapAssert containsEntries(..)tocontains - Change type
MapSubjecttoAbstractMapAssert - Change method name
com.google.common.truth.ObjectArraySubject asList()tocontainsExactly - Change type
ObjectArraySubjecttoAbstractObjectArrayAssert - Change type
BooleanSubjecttoAbstractBooleanAssert - Change type
IntegerSubjecttoAbstractIntegerAssert - Change type
LongSubjecttoAbstractLongAssert - Change type
DoubleSubjecttoAbstractDoubleAssert - Change type
FloatSubjecttoAbstractFloatAssert - Change type
BigDecimalSubjecttoAbstractBigDecimalAssert - Change type
PrimitiveBooleanArraySubjecttoAbstractBooleanArrayAssert - Change type
PrimitiveIntArraySubjecttoAbstractIntArrayAssert - Change type
PrimitiveLongArraySubjecttoAbstractLongArrayAssert - Change type
PrimitiveDoubleArraySubjecttoAbstractDoubleArrayAssert - Change type
PrimitiveFloatArraySubjecttoAbstractFloatArrayAssert - Change type
PrimitiveByteArraySubjecttoAbstractByteArrayAssert - Change type
PrimitiveCharArraySubjecttoAbstractCharArrayAssert - Change type
PrimitiveShortArraySubjecttoAbstractShortArrayAssert - Change type
Truth8toAssertions - Change type
OptionalIntSubjecttoAbstractOptionalIntAssert - Change type
OptionalLongSubjecttoAbstractOptionalLongAssert - Change type
OptionalDoubleSubjecttoAbstractOptionalDoubleAssert - Change type
StreamSubjecttoListAssert - Change type
IntStreamSubjecttoAbstractIntArrayAssert - Change type
LongStreamSubjecttoAbstractLongArrayAssert - Change type
PathSubjecttoAbstractPathAssert - Change type
ClassSubjecttoAbstractClassAssert - Change type
ThrowableSubjecttoAbstractThrowableAssert - Change type
TruthtoAssertions