Skip to content

Commit e8bfd20

Browse files
committed
[MediaCCC] Apply changes in extractor tests
Also remove some public test methods modifiers.
1 parent 0292c4f commit e8bfd20

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCConferenceExtractorTest.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import static org.junit.jupiter.api.Assertions.assertEquals;
1111
import static org.junit.jupiter.api.Assertions.assertTrue;
12+
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContainsImageUrlInImageCollection;
1213
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
1314

1415
/**
@@ -30,27 +31,29 @@ public static void setUpClass() throws Exception {
3031
}
3132

3233
@Test
33-
public void testName() throws Exception {
34+
void testName() throws Exception {
3435
assertEquals("FrOSCon 2017", extractor.getName());
3536
}
3637

3738
@Test
38-
public void testGetUrl() throws Exception {
39+
void testGetUrl() throws Exception {
3940
assertEquals("https://media.ccc.de/c/froscon2017", extractor.getUrl());
4041
}
4142

4243
@Test
43-
public void testGetOriginalUrl() throws Exception {
44+
void testGetOriginalUrl() throws Exception {
4445
assertEquals("https://media.ccc.de/c/froscon2017", extractor.getOriginalUrl());
4546
}
4647

4748
@Test
48-
public void testGetThumbnailUrl() throws Exception {
49-
assertEquals("https://static.media.ccc.de/media/events/froscon/2017/logo.png", extractor.getAvatarUrl());
49+
void testGetThumbnails() {
50+
assertContainsImageUrlInImageCollection(
51+
"https://static.media.ccc.de/media/events/froscon/2017/logo.png",
52+
extractor.getAvatars());
5053
}
5154

5255
@Test
53-
public void testGetInitalPage() throws Exception {
56+
void testGetInitalPage() throws Exception {
5457
assertEquals(97, tabExtractor.getInitialPage().getItems().size());
5558
}
5659
}
@@ -70,27 +73,29 @@ public static void setUpClass() throws Exception {
7073
}
7174

7275
@Test
73-
public void testName() throws Exception {
76+
void testName() throws Exception {
7477
assertEquals("Open Source Conference Albania 2019", extractor.getName());
7578
}
7679

7780
@Test
78-
public void testGetUrl() throws Exception {
81+
void testGetUrl() throws Exception {
7982
assertEquals("https://media.ccc.de/c/oscal19", extractor.getUrl());
8083
}
8184

8285
@Test
83-
public void testGetOriginalUrl() throws Exception {
86+
void testGetOriginalUrl() throws Exception {
8487
assertEquals("https://media.ccc.de/c/oscal19", extractor.getOriginalUrl());
8588
}
8689

8790
@Test
88-
public void testGetThumbnailUrl() throws Exception {
89-
assertEquals("https://static.media.ccc.de/media/events/oscal/2019/oscal-19.png", extractor.getAvatarUrl());
91+
void testGetThumbnailUrl() {
92+
assertContainsImageUrlInImageCollection(
93+
"https://static.media.ccc.de/media/events/oscal/2019/oscal-19.png",
94+
extractor.getAvatars());
9095
}
9196

9297
@Test
93-
public void testGetInitalPage() throws Exception {
98+
void testGetInitalPage() throws Exception {
9499
assertTrue(tabExtractor.getInitialPage().getItems().size() >= 21);
95100
}
96101
}

extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCStreamExtractorTest.java

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import static org.junit.jupiter.api.Assertions.assertEquals;
2323
import static org.junit.jupiter.api.Assertions.assertTrue;
24+
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContainsImageUrlInImageCollection;
2425
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
2526

2627
/**
@@ -66,16 +67,20 @@ public static void setUp() throws Exception {
6667

6768
@Override
6869
@Test
69-
public void testThumbnailUrl() throws Exception {
70-
super.testThumbnailUrl();
71-
assertEquals("https://static.media.ccc.de/media/events/gpn/gpn18/105-hd.jpg", extractor.getThumbnailUrl());
70+
public void testThumbnails() throws Exception {
71+
super.testThumbnails();
72+
assertContainsImageUrlInImageCollection(
73+
"https://static.media.ccc.de/media/events/gpn/gpn18/105-hd_preview.jpg",
74+
extractor.getThumbnails());
7275
}
7376

7477
@Override
7578
@Test
76-
public void testUploaderAvatarUrl() throws Exception {
77-
super.testUploaderAvatarUrl();
78-
assertEquals("https://static.media.ccc.de/media/events/gpn/gpn18/logo.png", extractor.getUploaderAvatarUrl());
79+
public void testUploaderAvatars() throws Exception {
80+
super.testUploaderAvatars();
81+
assertContainsImageUrlInImageCollection(
82+
"https://static.media.ccc.de/media/events/gpn/gpn18/logo.png",
83+
extractor.getUploaderAvatars());
7984
}
8085

8186
@Override
@@ -140,16 +145,20 @@ public static void setUp() throws Exception {
140145

141146
@Override
142147
@Test
143-
public void testThumbnailUrl() throws Exception {
144-
super.testThumbnailUrl();
145-
assertEquals("https://static.media.ccc.de/media/congress/2019/10565-hd.jpg", extractor.getThumbnailUrl());
148+
public void testThumbnails() throws Exception {
149+
super.testThumbnails();
150+
assertContainsImageUrlInImageCollection(
151+
"https://static.media.ccc.de/media/congress/2019/10565-hd_preview.jpg",
152+
extractor.getThumbnails());
146153
}
147154

148155
@Override
149156
@Test
150-
public void testUploaderAvatarUrl() throws Exception {
151-
super.testUploaderAvatarUrl();
152-
assertEquals("https://static.media.ccc.de/media/congress/2019/logo.png", extractor.getUploaderAvatarUrl());
157+
public void testUploaderAvatars() throws Exception {
158+
super.testUploaderAvatars();
159+
assertContainsImageUrlInImageCollection(
160+
"https://static.media.ccc.de/media/congress/2019/logo.png",
161+
extractor.getUploaderAvatars());
153162
}
154163

155164
@Override

0 commit comments

Comments
 (0)