Skip to content

Commit

Permalink
[MediaCCC] Apply changes in extractor tests
Browse files Browse the repository at this point in the history
Also remove some public test methods modifiers.
  • Loading branch information
AudricV committed Aug 6, 2022
1 parent 79ffe99 commit 97504b5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContainsImageUrlInImageCollection;
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;

/**
Expand All @@ -25,27 +26,29 @@ public static void setUpClass() throws Exception {
}

@Test
public void testName() throws Exception {
void testName() throws Exception {
assertEquals("FrOSCon 2017", extractor.getName());
}

@Test
public void testGetUrl() throws Exception {
void testGetUrl() throws Exception {
assertEquals("https://media.ccc.de/c/froscon2017", extractor.getUrl());
}

@Test
public void testGetOriginalUrl() throws Exception {
void testGetOriginalUrl() throws Exception {
assertEquals("https://media.ccc.de/c/froscon2017", extractor.getOriginalUrl());
}

@Test
public void testGetThumbnailUrl() throws Exception {
assertEquals("https://static.media.ccc.de/media/events/froscon/2017/logo.png", extractor.getAvatarUrl());
void testGetThumbnails() {
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/events/froscon/2017/logo.png",
extractor.getAvatars());
}

@Test
public void testGetInitalPage() throws Exception {
void testGetInitalPage() {
assertEquals(97, extractor.getInitialPage().getItems().size());
}
}
Expand All @@ -61,27 +64,29 @@ public static void setUpClass() throws Exception {
}

@Test
public void testName() throws Exception {
void testName() throws Exception {
assertEquals("Open Source Conference Albania 2019", extractor.getName());
}

@Test
public void testGetUrl() throws Exception {
void testGetUrl() throws Exception {
assertEquals("https://media.ccc.de/c/oscal19", extractor.getUrl());
}

@Test
public void testGetOriginalUrl() throws Exception {
void testGetOriginalUrl() throws Exception {
assertEquals("https://media.ccc.de/c/oscal19", extractor.getOriginalUrl());
}

@Test
public void testGetThumbnailUrl() throws Exception {
assertEquals("https://static.media.ccc.de/media/events/oscal/2019/oscal-19.png", extractor.getAvatarUrl());
void testGetThumbnailUrl() {
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/events/oscal/2019/oscal-19.png",
extractor.getAvatars());
}

@Test
public void testGetInitalPage() throws Exception {
void testGetInitalPage() {
assertTrue(extractor.getInitialPage().getItems().size() >= 21);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Locale;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertContainsImageUrlInImageCollection;
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;

/**
Expand Down Expand Up @@ -62,16 +63,20 @@ public static void setUp() throws Exception {

@Override
@Test
public void testThumbnailUrl() throws Exception {
super.testThumbnailUrl();
assertEquals("https://static.media.ccc.de/media/events/gpn/gpn18/105-hd.jpg", extractor.getThumbnailUrl());
public void testThumbnails() throws Exception {
super.testThumbnails();
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/events/gpn/gpn18/105-hd_preview.jpg",
extractor.getThumbnails());
}

@Override
@Test
public void testUploaderAvatarUrl() throws Exception {
super.testUploaderAvatarUrl();
assertEquals("https://static.media.ccc.de/media/events/gpn/gpn18/logo.png", extractor.getUploaderAvatarUrl());
public void testUploaderAvatars() throws Exception {
super.testUploaderAvatars();
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/events/gpn/gpn18/logo.png",
extractor.getUploaderAvatars());
}

@Override
Expand Down Expand Up @@ -132,16 +137,20 @@ public static void setUp() throws Exception {

@Override
@Test
public void testThumbnailUrl() throws Exception {
super.testThumbnailUrl();
assertEquals("https://static.media.ccc.de/media/congress/2019/10565-hd.jpg", extractor.getThumbnailUrl());
public void testThumbnails() throws Exception {
super.testThumbnails();
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/congress/2019/10565-hd_preview.jpg",
extractor.getThumbnails());
}

@Override
@Test
public void testUploaderAvatarUrl() throws Exception {
super.testUploaderAvatarUrl();
assertEquals("https://static.media.ccc.de/media/congress/2019/logo.png", extractor.getUploaderAvatarUrl());
public void testUploaderAvatars() throws Exception {
super.testUploaderAvatars();
assertContainsImageUrlInImageCollection(
"https://static.media.ccc.de/media/congress/2019/logo.png",
extractor.getUploaderAvatars());
}

@Override
Expand Down

0 comments on commit 97504b5

Please sign in to comment.