From c220700c94d89e967236c2ba3a8790265fa3c096 Mon Sep 17 00:00:00 2001 From: Ritvik Saraf <13ritvik@gmail.com> Date: Sun, 10 Mar 2019 00:30:01 +0530 Subject: [PATCH] fixed tests --- .../services/media_ccc/MediaCCCSearchExtractorEventsTest.java | 2 +- .../services/peertube/PeertubeTrendingExtractorTest.java | 2 ++ .../peertube/PeertubeTrendingLinkHandlerFactoryTest.java | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCSearchExtractorEventsTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCSearchExtractorEventsTest.java index 11b1fbdfb..81e8ed980 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCSearchExtractorEventsTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCSearchExtractorEventsTest.java @@ -44,7 +44,7 @@ public class MediaCCCSearchExtractorEventsTest { @Test public void testServiceId() throws Exception { - assertEquals(2, extractor.getServiceId()); + assertEquals(3, extractor.getServiceId()); } @Test diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingExtractorTest.java index e11bb5ee0..67b3f0261 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingExtractorTest.java @@ -28,6 +28,8 @@ public class PeertubeTrendingExtractorTest { @BeforeClass public static void setUp() throws Exception { NewPipe.init(Downloader.getInstance(), new Localization("GB", "en")); + // setting instance might break test when running in parallel + PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"); extractor = PeerTube .getKioskList() .getExtractorById("Trending", null); diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingLinkHandlerFactoryTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingLinkHandlerFactoryTest.java index 6febed8d0..6bf1fbb3e 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingLinkHandlerFactoryTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeTrendingLinkHandlerFactoryTest.java @@ -2,6 +2,7 @@ package org.schabi.newpipe.extractor.services.peertube; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import static org.schabi.newpipe.extractor.ServiceList.PeerTube; import org.junit.BeforeClass; import org.junit.Test; @@ -20,6 +21,8 @@ public class PeertubeTrendingLinkHandlerFactoryTest { @BeforeClass public static void setUp() throws Exception { + // setting instance might break test when running in parallel + PeerTube.setInstance("https://peertube.mastodon.host", "PeerTube on Mastodon.host"); LinkHandlerFactory = new PeertubeTrendingLinkHandlerFactory(); NewPipe.init(Downloader.getInstance(), new Localization("GB", "en")); }