summaryrefslogtreecommitdiff
path: root/app/src/androidTest/java/de/test/antennapod/util
diff options
context:
space:
mode:
authorTacoTheDank <SkytkRSfan3895@gmail.com>2020-07-13 00:49:35 -0400
committerTacoTheDank <SkytkRSfan3895@gmail.com>2020-07-13 00:49:35 -0400
commit24656936c70bc73443119b4e1bb492feeac6dd85 (patch)
treecf810ab31c9fa4bd16e57ce74e252e0ab092c9a5 /app/src/androidTest/java/de/test/antennapod/util
parent078f97e609c2471dfe66c654810dc507ca656109 (diff)
downloadAntennaPod-24656936c70bc73443119b4e1bb492feeac6dd85.zip
Fix a bunch of deprecations
Diffstat (limited to 'app/src/androidTest/java/de/test/antennapod/util')
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java4
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java8
2 files changed, 7 insertions, 5 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java b/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
index 59b9ceaca..ed37b7daa 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/playback/TimelineTest.java
@@ -2,7 +2,7 @@ package de.test.antennapod.util.playback;
import android.content.Context;
-import androidx.test.InstrumentationRegistry;
+import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
@@ -35,7 +35,7 @@ public class TimelineTest {
@Before
public void setUp() {
- context = InstrumentationRegistry.getTargetContext();
+ context = InstrumentationRegistry.getInstrumentation().getTargetContext();
}
private Playable newTestPlayable(List<Chapter> chapters, String shownotes, int duration) {
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java
index 2dda77524..b213a5efa 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/FeedDiscovererTest.java
@@ -1,11 +1,12 @@
package de.test.antennapod.util.syndication;
-import androidx.test.InstrumentationRegistry;
+import androidx.test.platform.app.InstrumentationRegistry;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import java.io.File;
import java.io.FileOutputStream;
+import java.nio.charset.Charset;
import java.util.Map;
import de.danoeh.antennapod.core.util.syndication.FeedDiscoverer;
@@ -29,7 +30,8 @@ public class FeedDiscovererTest {
@Before
public void setUp() throws Exception {
fd = new FeedDiscoverer();
- testDir = new File(InstrumentationRegistry.getTargetContext().getFilesDir(), "FeedDiscovererTest");
+ testDir = new File(InstrumentationRegistry
+ .getInstrumentation().getTargetContext().getFilesDir(), "FeedDiscovererTest");
testDir.mkdir();
assertTrue(testDir.exists());
}
@@ -67,7 +69,7 @@ public class FeedDiscovererTest {
} else {
File testFile = new File(testDir, "feed");
FileOutputStream out = new FileOutputStream(testFile);
- IOUtils.write(html, out);
+ IOUtils.write(html, out, Charset.forName("UTF-8"));
out.close();
res = fd.findLinks(testFile, base);
}