|
6 | 6 | import static org.schabi.newpipe.extractor.ServiceList.MediaCCC; |
7 | 7 | import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty; |
8 | 8 |
|
9 | | -import org.junit.jupiter.api.BeforeAll; |
10 | 9 | import org.junit.jupiter.api.Test; |
11 | 10 | import org.junit.jupiter.api.function.Executable; |
12 | 11 | import org.schabi.newpipe.extractor.InitNewPipeTest; |
13 | 12 | import org.schabi.newpipe.extractor.kiosk.KioskExtractor; |
| 13 | +import org.schabi.newpipe.extractor.services.DefaultSimpleExtractorTest; |
14 | 14 | import org.schabi.newpipe.extractor.stream.StreamInfoItem; |
15 | 15 |
|
16 | 16 | import java.util.List; |
17 | 17 | import java.util.stream.Stream; |
18 | 18 |
|
19 | | -public class MediaCCCRecentListExtractorTest implements InitNewPipeTest { |
20 | | - private KioskExtractor extractor; |
| 19 | +public class MediaCCCRecentListExtractorTest extends DefaultSimpleExtractorTest<KioskExtractor> |
| 20 | + implements InitNewPipeTest { |
21 | 21 |
|
22 | 22 | @Override |
23 | | - @BeforeAll |
24 | | - public void setUp() throws Exception { |
25 | | - InitNewPipeTest.super.setUp(); |
26 | | - extractor = MediaCCC.getKioskList().getExtractorById("recent", null); |
27 | | - extractor.fetchPage(); |
| 23 | + protected KioskExtractor createExtractor() throws Exception { |
| 24 | + return MediaCCC.getKioskList().getExtractorById("recent", null); |
28 | 25 | } |
29 | 26 |
|
30 | 27 | @Test |
31 | 28 | void testStreamList() throws Exception { |
32 | | - final List<StreamInfoItem> items = extractor.getInitialPage().getItems(); |
| 29 | + final List<StreamInfoItem> items = extractor().getInitialPage().getItems(); |
33 | 30 | assertFalse(items.isEmpty(), "No items returned"); |
34 | 31 |
|
35 | 32 | assertAll(items.stream().flatMap(this::getAllConditionsForItem)); |
|
0 commit comments