diff --git a/app/src/main/assets/30sec.mp3 b/app/src/androidTest/assets/30sec.mp3 similarity index 100% rename from app/src/main/assets/30sec.mp3 rename to app/src/androidTest/assets/30sec.mp3 diff --git a/app/src/main/assets/3sec.mp3 b/app/src/androidTest/assets/3sec.mp3 similarity index 100% rename from app/src/main/assets/3sec.mp3 rename to app/src/androidTest/assets/3sec.mp3 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 e115bc34e..aa2f1cf98 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 @@ -85,7 +85,7 @@ public class PlaybackServiceMediaPlayerTest { assertTrue(cacheDir.canWrite()); assertTrue(cacheDir.canRead()); if (!dest.exists()) { - InputStream i = getInstrumentation().getTargetContext().getAssets().open("3sec.mp3"); + InputStream i = getInstrumentation().getContext().getAssets().open("3sec.mp3"); OutputStream o = new FileOutputStream(new File(cacheDir, PLAYABLE_DEST_URL)); IOUtils.copy(i, o); o.flush(); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java index 834c7d48b..44a11d9cf 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/UITestUtils.java @@ -2,6 +2,9 @@ package de.test.antennapod.ui; import android.content.Context; import android.util.Log; + +import androidx.test.platform.app.InstrumentationRegistry; + import de.danoeh.antennapod.event.FeedListUpdateEvent; import de.danoeh.antennapod.event.QueueEvent; import de.danoeh.antennapod.model.feed.Feed; @@ -99,7 +102,8 @@ public class UITestUtils { } Assert.assertFalse(mediaFile.exists()); - InputStream in = context.getAssets().open(testFileName); + InputStream in = InstrumentationRegistry.getInstrumentation().getContext() + .getAssets().open(testFileName); Assert.assertNotNull(in); FileOutputStream out = new FileOutputStream(mediaFile);