Skip to content

Commit 5bb4691

Browse files
cpovirkglide-copybara-robot
authored andcommittedJun 5, 2019
Update to Truth 0.45, and address deprecations.
Renames may include: - containsAllOf => containsAtLeast - containsAllIn => containsAtLeastElementsIn - isSameAs => isSameInstanceAs - isOrdered => isInOrder - isStrictlyOrdered => isInStrictOrder The other major change is to change custom subjects to extend raw Subject instead of supplying type parameters. The type parameters are being removed from Subject. This CL will temporarily produce rawtypes warnings, which will go away when I remove the type parameters (as soon as this batch of CLs is submitted). Some CLs in this batch also migrate calls away from actualAsString(). Its literal replacement is `"<" + actual + ">"` (unless an object overrides actualCustomStringRepresentation()), but usually I've made a larger change, such as switching from an old-style "Not true that..." failure message to one generated with the Fact API. In that case, the new code usually contains a direct reference to this.actual (a field that I occasionally had to create). Another larger change I sometimes made is to switch from a manual check-and-fail approach to instead use check(...). And sometimes I just remove a withMessage() call that's no longer necessary now that the code uses check(...), or I introduce a check(...) call. (An assertion made with check(...) automatically includes the actual value from the original subject, so there's no need to set it again with withMessage().) Finally, there's one CL in this batch in which I migrate a Correspondence subclass to instead use Correspondence.from. PiperOrigin-RevId: 251729082
1 parent c3ff2e5 commit 5bb4691

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ MOCKITO_VERSION=1.9.5
2929
MOCKITO_ANDROID_VERSION=2.24.0
3030
ROBOLECTRIC_VERSION=4.3-beta-1
3131
MOCKWEBSERVER_VERSION=3.0.0-RC1
32-
TRUTH_VERSION=0.44
32+
TRUTH_VERSION=0.45
3333
JSR_305_VERSION=3.0.2
3434
AUTO_SERVICE_VERSION=1.0-rc3
3535
JAVAPOET_VERSION=1.9.0

‎instrumentation/src/androidTest/java/com/bumptech/glide/WideGamutTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void load_withWideGamutImage_bitmapInPoolWithSizeAndConfig_usesBitmapFrom
6060
Bitmap bitmap =
6161
concurrency.get(
6262
Glide.with(context).asBitmap().load(ResourceIds.raw.webkit_logo_p3).submit());
63-
assertThat(bitmap).isSameAs(expected);
63+
assertThat(bitmap).isSameInstanceAs(expected);
6464
}
6565

6666
// TODO: Even with hardware allowed, we get a wide F16. Attempting to decode the resource with
@@ -172,7 +172,7 @@ public void loadWideGamutImage_withArgb888OfSufficientSizeInPool_usesArgb8888Bit
172172

173173
Bitmap result = concurrency.get(Glide.with(context).asBitmap().load(data).submit());
174174

175-
assertThat(result).isSameAs(argb8888);
175+
assertThat(result).isSameInstanceAs(argb8888);
176176
}
177177

178178
private static byte[] asJpeg(Bitmap bitmap) {

‎instrumentation/src/androidTest/java/com/bumptech/glide/test/BitmapSubject.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
/** Truth assertions for comparing {@link Bitmap}s. */
1818
// Test APIs.
19-
@SuppressWarnings({"WeakerAccess", "unused"})
20-
public final class BitmapSubject extends Subject<BitmapSubject, Bitmap> {
19+
@SuppressWarnings({"WeakerAccess", "unused", "rawtypes", "unchecked"})
20+
public final class BitmapSubject extends Subject {
2121

2222
private static final Subject.Factory<BitmapSubject, Bitmap> FACTORY =
2323
new Subject.Factory<BitmapSubject, Bitmap>() {

‎third_party/disklrucache/src/test/java/com/bumptech/glide/disklrucache/DiskLruCacheTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public static void setUpClass() {
524524
@Test public void readingTheSameFileMultipleTimes() throws Exception {
525525
set("a", "a", "b");
526526
DiskLruCache.Value value = cache.get("a");
527-
assertThat(value.getFile(0)).isSameAs(value.getFile(0));
527+
assertThat(value.getFile(0)).isSameInstanceAs(value.getFile(0));
528528
}
529529

530530
@Test public void rebuildJournalOnRepeatedReads() throws Exception {

0 commit comments

Comments
 (0)
Please sign in to comment.