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 | |
parent | a20ef049e1776672a8508eb9e960d730e015c375 (diff) | |
download | AntennaPod-09dc16c6519bdd40841c445c42b2f40293621b34.zip |
Fixed asset not being found
Diffstat (limited to 'app/src/androidTest/java/de')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/service/playback/PlaybackServiceMediaPlayerTest.java | 8 | ||||
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/ui/SpeedChangeTest.java | 6 |
2 files changed, 7 insertions, 7 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(); diff --git a/app/src/androidTest/java/de/test/antennapod/ui/SpeedChangeTest.java b/app/src/androidTest/java/de/test/antennapod/ui/SpeedChangeTest.java index d28858f72..84a7a23bb 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/SpeedChangeTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/SpeedChangeTest.java @@ -88,7 +88,7 @@ public class SpeedChangeTest { public void testChangeSpeedPlaying() { onView(isRoot()).perform(waitForView(withId(R.id.butPlay), 1000)); onView(withId(R.id.butPlay)).perform(click()); - Awaitility.await().atMost(1, TimeUnit.SECONDS).until(() + Awaitility.await().atMost(2, TimeUnit.SECONDS).until(() -> activityRule.getActivity().getPlaybackController().getStatus() == PlayerStatus.PLAYING); clickThroughSpeeds(); } @@ -97,10 +97,10 @@ public class SpeedChangeTest { public void testChangeSpeedPaused() { onView(isRoot()).perform(waitForView(withId(R.id.butPlay), 1000)); onView(withId(R.id.butPlay)).perform(click()); - Awaitility.await().atMost(1, TimeUnit.SECONDS).until(() + Awaitility.await().atMost(2, TimeUnit.SECONDS).until(() -> activityRule.getActivity().getPlaybackController().getStatus() == PlayerStatus.PLAYING); onView(withId(R.id.butPlay)).perform(click()); - Awaitility.await().atMost(1, TimeUnit.SECONDS).until(() + Awaitility.await().atMost(2, TimeUnit.SECONDS).until(() -> activityRule.getActivity().getPlaybackController().getStatus() == PlayerStatus.PAUSED); clickThroughSpeeds(); } |