Use ISE instead of AssertionError in MockMediaLibraryService

Also pass the full cause instead of just the message.

PiperOrigin-RevId: 564313917
This commit is contained in:
ibaker 2023-09-11 02:25:54 -07:00 committed by Copybara-Service
parent 23665090ed
commit d77c707cd3

View File

@ -53,7 +53,6 @@ import static androidx.media3.test.session.common.MediaBrowserConstants.SUBSCRIB
import static androidx.media3.test.session.common.MediaBrowserConstants.SUBSCRIBE_ID_NOTIFY_CHILDREN_CHANGED_TO_ONE;
import static androidx.media3.test.session.common.MediaBrowserConstants.SUBSCRIBE_ID_NOTIFY_CHILDREN_CHANGED_TO_ONE_WITH_NON_SUBSCRIBED_ID;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.junit.Assert.fail;
import android.app.PendingIntent;
import android.app.Service;
@ -523,7 +522,7 @@ public class MockMediaLibraryService extends MediaLibraryService {
testArtworkData =
TestUtils.getByteArrayForScaledBitmap(getApplicationContext(), TEST_IMAGE_PATH);
} catch (IOException e) {
fail(e.getMessage());
throw new IllegalStateException(e);
}
return testArtworkData;
}