diff options
author | ByteHamster <info@bytehamster.com> | 2019-12-02 10:44:06 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2019-12-12 09:47:16 +0100 |
commit | 09dc16c6519bdd40841c445c42b2f40293621b34 (patch) | |
tree | 1c1a36f76f38146ddf0dd83cac24fa9121241ce1 /app/src/androidTest/java/de/test/antennapod/service | |
parent | a20ef049e1776672a8508eb9e960d730e015c375 (diff) | |
download | AntennaPod-09dc16c6519bdd40841c445c42b2f40293621b34.zip |
Fixed asset not being found
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/service')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java index 00fc68598..c17324750 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java @@ -2,8 +2,8 @@ package de.test.antennapod.service.playback; import android.content.Context; -import androidx.test.InstrumentationRegistry; import androidx.test.filters.MediumTest; +import androidx.test.platform.app.InstrumentationRegistry; import de.test.antennapod.EspressoTestUtils; import junit.framework.AssertionFailedError; @@ -32,7 +32,7 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; -import static androidx.test.InstrumentationRegistry.getInstrumentation; +import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; @@ -66,7 +66,7 @@ public class PlaybackServiceMediaPlayerTest { EspressoTestUtils.makeNotFirstRun(); EspressoTestUtils.clearDatabase(); - final Context context = InstrumentationRegistry.getTargetContext(); + final Context context = getInstrumentation().getTargetContext(); httpServer = new HTTPBin(); httpServer.start(); @@ -81,7 +81,7 @@ public class PlaybackServiceMediaPlayerTest { assertTrue(cacheDir.canWrite()); assertTrue(cacheDir.canRead()); if (!dest.exists()) { - InputStream i = InstrumentationRegistry.getContext().getAssets().open("3sec.mp3"); + InputStream i = getInstrumentation().getTargetContext().getAssets().open("3sec.mp3"); OutputStream o = new FileOutputStream(new File(cacheDir, PLAYABLE_DEST_URL)); IOUtils.copy(i, o); o.flush(); |