Skip to content

Truth 0.44

Compare
Choose a tag to compare
@cpovirk cpovirk released this 05 Apr 15:14
· 639 commits to master since this release

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 and isNotSameAs. Use isSameInstanceAs and isNotSameInstanceAs, which are equivalent. (bc845f0)
  • Deprecated IterableSubject.containsAllOf and containsAllIn. Use the containsAtLeast and containsAtLeastElementsIn, which are equivalent. (bc845f0)
  • Deprecated the no-arg Subject.check(). Use the overload that accepts a description. (To help with this migration, we have added ProvideDescriptionToCheck 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 released CorrespondenceSubclassToFactoryCall. (bc845f0, 8bd19b4)
  • Deprecated MathUtil. For similar static methods, see Guava's DoubleMath.fuzzyEquals. But callers from custom Subject implementations may prefer an approach like check("score()").that(actual.score()).isWithin(tolerance).of(expected). (bc845f0)
  • Removed deprecated ComparableSubject.comparesEqualTo and Primitive{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 existing Correspondence using Correspondence.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.