diff --git a/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java b/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java index 6518465b88..f9d1d9ce8c 100644 --- a/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java +++ b/testutils/src/main/java/com/google/android/exoplayer2/testutil/MediaSourceTestRunner.java @@ -215,7 +215,7 @@ public class MediaSourceTestRunner { * runner was created if neither method has been called). */ public void assertNoTimelineChange() { - assertThat(timelines.isEmpty()).isTrue(); + assertThat(timelines).isEmpty(); } /** @@ -304,8 +304,10 @@ public class MediaSourceTestRunner { List expectedWindowIndices = new ArrayList<>(Arrays.asList(windowIndices)); for (Pair windowIndexAndMediaPeriodId : completedLoads) { if (windowIndexAndMediaPeriodId.second == null) { - boolean loadExpected = expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first); - assertThat(loadExpected).isTrue(); + assertWithMessage("Missing expected load") + .that(expectedWindowIndices) + .contains(windowIndexAndMediaPeriodId.first); + expectedWindowIndices.remove(windowIndexAndMediaPeriodId.first); } } assertWithMessage("Not all expected media source loads have been completed.")