This release marks a major milestone in that it moves to Truth stable, and migrates to AndroidX.
Assertion chaining It used to be possible to write code like
assertThat(layout).isVisible()
.hasChildCount(4);Now, this code must be written as
assertThat(layout).isVisible();
assertThat(layout).hasChildCount(4);Android Studio's Structured Search/Replace can be used effectively to migrate your code.
Truth 1.0 Truth 1.0 introduced significant API changes. See their changelog for migration information.
AndroidX AndroidX is the replacement for the Android Support Library. See their migration guide for details on migrating your application.
- Update Truth to version 1.0. This has breaking API changes.
- Migrate from Android Support Library to AndroidX. This has breaking API changes.
- Add nullability annotations. All
publicmethods should be properly annotated for optimized interop with Kotlin. Subjectmethods no longer return a reference to theSubject. This means assertion chaining is no longer possible. This is more in line with how Truth itself works, rather than how AssertJ works.- Multiple bug fixes in assertions.
- Update Truth to version 0.42. This has breaking API changes
- Update Support Library. This has breaking API changes
Feature parity with AssertJ Android