Skip to content

Commit 1d72bac

Browse files
committed
[SoundCloud] Apply changes in extractor tests
1 parent 93a2103 commit 1d72bac

2 files changed

Lines changed: 45 additions & 36 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelExtractorTest.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
import org.schabi.newpipe.extractor.services.BaseChannelExtractorTest;
1010
import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudChannelExtractor;
1111

12-
import static org.junit.jupiter.api.Assertions.*;
12+
import static org.junit.jupiter.api.Assertions.assertEquals;
13+
import static org.junit.jupiter.api.Assertions.assertNotNull;
14+
import static org.junit.jupiter.api.Assertions.assertTrue;
1315
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
14-
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
1516
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertTabsContain;
1617
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
18+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
1719

1820
/**
1921
* Test for {@link SoundcloudChannelExtractor}
@@ -69,13 +71,13 @@ public void testDescription() {
6971
}
7072

7173
@Test
72-
public void testAvatarUrl() {
73-
assertIsSecureUrl(extractor.getAvatarUrl());
74+
public void testAvatars() {
75+
defaultTestImageCollection(extractor.getAvatars());
7476
}
7577

7678
@Test
77-
public void testBannerUrl() {
78-
assertIsSecureUrl(extractor.getBannerUrl());
79+
public void testBanners() {
80+
defaultTestImageCollection(extractor.getBanners());
7981
}
8082

8183
@Test
@@ -157,13 +159,13 @@ public void testDescription() {
157159
}
158160

159161
@Test
160-
public void testAvatarUrl() {
161-
assertIsSecureUrl(extractor.getAvatarUrl());
162+
public void testAvatars() {
163+
defaultTestImageCollection(extractor.getAvatars());
162164
}
163165

164166
@Test
165-
public void testBannerUrl() {
166-
assertIsSecureUrl(extractor.getBannerUrl());
167+
public void testBanners() {
168+
defaultTestImageCollection(extractor.getBanners());
167169
}
168170

169171
@Test

extractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractorTest.java

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@
1313
import org.schabi.newpipe.extractor.services.soundcloud.extractors.SoundcloudPlaylistExtractor;
1414
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
1515

16-
import static org.junit.jupiter.api.Assertions.*;
16+
import static org.junit.jupiter.api.Assertions.assertEquals;
17+
import static org.junit.jupiter.api.Assertions.assertFalse;
18+
import static org.junit.jupiter.api.Assertions.assertTrue;
19+
import static org.junit.jupiter.api.Assertions.fail;
1720
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
1821
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
1922
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
20-
import static org.schabi.newpipe.extractor.services.DefaultTests.*;
23+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestGetPageInNewExtractor;
24+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
25+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestListOfItems;
26+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestMoreItems;
27+
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
2128

2229
/**
2330
* Test for {@link PlaylistExtractor}
@@ -82,14 +89,14 @@ public void testMoreRelatedItems() throws Exception {
8289
//////////////////////////////////////////////////////////////////////////*/
8390

8491
@Test
85-
public void testThumbnailUrl() {
86-
assertIsSecureUrl(extractor.getThumbnailUrl());
92+
public void testThumbnails() {
93+
defaultTestImageCollection(extractor.getThumbnails());
8794
}
8895

8996
@Test
90-
public void testBannerUrl() throws ParsingException {
97+
public void testBanners() throws ParsingException {
9198
// SoundCloud playlists do not have a banner
92-
assertEmpty(extractor.getBannerUrl());
99+
assertEmpty(extractor.getBanners());
93100
}
94101

95102
@Test
@@ -105,8 +112,8 @@ public void testUploaderName() {
105112
}
106113

107114
@Test
108-
public void testUploaderAvatarUrl() {
109-
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
115+
public void testUploaderAvatars() {
116+
defaultTestImageCollection(extractor.getUploaderAvatars());
110117
}
111118

112119
@Test
@@ -179,14 +186,14 @@ public void testMoreRelatedItems() throws Exception {
179186
//////////////////////////////////////////////////////////////////////////*/
180187

181188
@Test
182-
public void testThumbnailUrl() {
183-
assertIsSecureUrl(extractor.getThumbnailUrl());
189+
public void testThumbnails() {
190+
defaultTestImageCollection(extractor.getThumbnails());
184191
}
185192

186193
@Test
187-
public void testBannerUrl() throws ParsingException {
194+
public void testBanners() throws ParsingException {
188195
// SoundCloud playlists do not have a banner
189-
assertEmpty(extractor.getBannerUrl());
196+
assertEmpty(extractor.getBanners());
190197
}
191198

192199
@Test
@@ -202,8 +209,8 @@ public void testUploaderName() {
202209
}
203210

204211
@Test
205-
public void testUploaderAvatarUrl() {
206-
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
212+
public void testUploaderAvatars() {
213+
defaultTestImageCollection(extractor.getUploaderAvatars());
207214
}
208215

209216
@Test
@@ -291,14 +298,14 @@ public void testMoreRelatedItems() throws Exception {
291298
//////////////////////////////////////////////////////////////////////////*/
292299

293300
@Test
294-
public void testThumbnailUrl() {
295-
assertIsSecureUrl(extractor.getThumbnailUrl());
301+
public void testThumbnails() {
302+
defaultTestImageCollection(extractor.getThumbnails());
296303
}
297304

298305
@Test
299-
public void testBannerUrl() throws ParsingException {
306+
public void testBanners() throws ParsingException {
300307
// SoundCloud playlists do not have a banner
301-
assertEmpty(extractor.getBannerUrl());
308+
assertEmpty(extractor.getBanners());
302309
}
303310

304311
@Test
@@ -314,8 +321,8 @@ public void testUploaderName() {
314321
}
315322

316323
@Test
317-
public void testUploaderAvatarUrl() {
318-
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
324+
public void testUploaderAvatars() {
325+
defaultTestImageCollection(extractor.getUploaderAvatars());
319326
}
320327

321328
@Test
@@ -395,14 +402,14 @@ public void testMoreRelatedItems() throws Exception {
395402
//////////////////////////////////////////////////////////////////////////*/
396403

397404
@Test
398-
public void testThumbnailUrl() {
399-
assertIsSecureUrl(extractor.getThumbnailUrl());
405+
public void testThumbnails() {
406+
defaultTestImageCollection(extractor.getThumbnails());
400407
}
401408

402409
@Test
403-
public void testBannerUrl() throws ParsingException {
410+
public void testBanners() throws ParsingException {
404411
// SoundCloud playlists do not have a banner
405-
assertEmpty(extractor.getBannerUrl());
412+
assertEmpty(extractor.getBanners());
406413
}
407414

408415
@Test
@@ -418,8 +425,8 @@ public void testUploaderName() {
418425
}
419426

420427
@Test
421-
public void testUploaderAvatarUrl() {
422-
assertIsSecureUrl(extractor.getUploaderAvatarUrl());
428+
public void testUploaderAvatars() {
429+
defaultTestImageCollection(extractor.getUploaderAvatars());
423430
}
424431

425432
@Test

0 commit comments

Comments
 (0)