Truth 0.44
To use the migration tools below, you'll need to set up Error Prone and configure our tools as plugins to run in patch mode.
- Deprecated
Subject.isSameAs
andisNotSameAs
. UseisSameInstanceAs
andisNotSameInstanceAs
, which are equivalent. (bc845f0) - Deprecated
IterableSubject.containsAllOf
andcontainsAllIn
. Use thecontainsAtLeast
andcontainsAtLeastElementsIn
, which are equivalent. (bc845f0) - Deprecated the no-arg
Subject.check()
. Use the overload that accepts a description. (To help with this migration, we have addedProvideDescriptionToCheck
to Error Prone -- but then removed it before it became part of a release, so you'll need to pull it in manually.) (bc845f0) - Deprecated
Expect.createAndEnableStackTrace()
.Expect.create()
now does the same thing. (bc845f0) - Deprecated the constructor of
Correspondence
. Instead of extending the type, use its new static factories. To help with migration, we're releasedCorrespondenceSubclassToFactoryCall
. (bc845f0, 8bd19b4) - Deprecated
MathUtil
. For similar static methods, see Guava'sDoubleMath.fuzzyEquals
. But callers from customSubject
implementations may prefer an approach likecheck("score()").that(actual.score()).isWithin(tolerance).of(expected)
. (bc845f0) - Removed deprecated
ComparableSubject.comparesEqualTo
andPrimitive{Double,Float}ArraySubject.hasValues{,Not}Within
. (cc796b3) - Removed deprecated
ThrowableSubject.hasMessage()
(3164a24) - You can now create a
Correspondence
instance that adds in diff-formatting behavior to an existingCorrespondence
usingCorrespondence.formattingDiffsUsing
. (d222360)
Also note that the next version of Error Prone will include ImplementAssertionWithChaining
, which is sometimes useful for migrating off the deprecated Subject.fail*
methods.