|
2 | 2 |
|
3 | 3 | package org.schabi.newpipe.extractor.services.bandcamp; |
4 | 4 |
|
| 5 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 6 | +import static org.junit.jupiter.api.Assertions.assertTrue; |
| 7 | +import static org.schabi.newpipe.extractor.ServiceList.Bandcamp; |
| 8 | + |
5 | 9 | import org.junit.jupiter.api.BeforeAll; |
6 | 10 | import org.junit.jupiter.api.Test; |
7 | 11 | import org.schabi.newpipe.downloader.DownloaderTestImpl; |
8 | | -import org.schabi.newpipe.extractor.*; |
| 12 | +import org.schabi.newpipe.extractor.InfoItem; |
| 13 | +import org.schabi.newpipe.extractor.ListExtractor; |
| 14 | +import org.schabi.newpipe.extractor.NewPipe; |
| 15 | +import org.schabi.newpipe.extractor.Page; |
| 16 | +import org.schabi.newpipe.extractor.StreamingService; |
9 | 17 | import org.schabi.newpipe.extractor.exceptions.ExtractionException; |
10 | 18 | import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; |
11 | 19 | import org.schabi.newpipe.extractor.search.SearchExtractor; |
12 | 20 | import org.schabi.newpipe.extractor.services.DefaultSearchExtractorTest; |
13 | 21 | import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampSearchExtractor; |
14 | 22 | import org.schabi.newpipe.extractor.stream.StreamInfoItem; |
15 | 23 |
|
16 | | -import javax.annotation.Nullable; |
17 | 24 | import java.io.IOException; |
18 | 25 |
|
19 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
20 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
21 | | -import static org.schabi.newpipe.extractor.ServiceList.Bandcamp; |
| 26 | +import javax.annotation.Nullable; |
22 | 27 |
|
23 | 28 | /** |
24 | 29 | * Test for {@link BandcampSearchExtractor} |
@@ -73,20 +78,17 @@ void testChannelSearch() throws ExtractionException, IOException { |
73 | 78 | @Test |
74 | 79 | void testAlbumSearch() throws ExtractionException, IOException { |
75 | 80 | final SearchExtractor extractor = Bandcamp.getSearchExtractor("minecraft volume alpha"); |
76 | | - InfoItem minecraft = extractor.getInitialPage() |
77 | | - .getItems().get(0); |
| 81 | + final InfoItem minecraft = extractor.getInitialPage().getItems().get(0); |
78 | 82 |
|
79 | 83 | // Minecraft volume alpha should be the first result, no? |
80 | | - assertEquals("Minecraft: Volume Alpha (cover)", minecraft.getName()); |
| 84 | + assertEquals("Minecraft - Volume Alpha", minecraft.getName()); |
81 | 85 | assertTrue(minecraft.getThumbnailUrl().endsWith(".jpg")); |
82 | 86 | assertTrue(minecraft.getThumbnailUrl().contains("f4.bcbits.com/img/")); |
83 | | - assertEquals( |
84 | | - "https://chromacat248.bandcamp.com/album/minecraft-volume-alpha-cover", |
| 87 | + assertEquals("https://c418.bandcamp.com/album/minecraft-volume-alpha", |
85 | 88 | minecraft.getUrl()); |
86 | 89 |
|
87 | 90 | // Verify that playlist tracks counts get extracted correctly |
88 | | - assertEquals(3, ((PlaylistInfoItem) minecraft).getStreamCount()); |
89 | | - |
| 91 | + assertEquals(24, ((PlaylistInfoItem) minecraft).getStreamCount()); |
90 | 92 | } |
91 | 93 |
|
92 | 94 | /** |
|
0 commit comments