Update avatar, banners and thumbnail methods' name and apply changes in DefaultStreamExtractorTest

This commit is contained in:
AudricV 2022-08-03 16:01:38 +02:00
parent 434e885708
commit d381f3b70b
No known key found for this signature in database
GPG Key ID: DA92EC7905614198
1 changed files with 10 additions and 8 deletions

View File

@ -29,10 +29,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertGreaterOrEqual; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderIndependent; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderIndependent;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertGreaterOrEqual;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsValidUrl; import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsValidUrl;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestListOfItems; import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestListOfItems;
import static org.schabi.newpipe.extractor.stream.StreamExtractor.UNKNOWN_SUBSCRIBER_COUNT; import static org.schabi.newpipe.extractor.stream.StreamExtractor.UNKNOWN_SUBSCRIBER_COUNT;
@ -98,8 +100,8 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
@Test @Test
@Override @Override
public void testUploaderAvatarUrl() throws Exception { public void testUploaderAvatars() throws Exception {
assertIsSecureUrl(extractor().getUploaderAvatarUrl()); defaultTestImageCollection(extractor().getUploaderAvatars());
} }
@Test @Test
@ -137,20 +139,20 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
@Test @Test
@Override @Override
public void testSubChannelAvatarUrl() throws Exception { public void testSubChannelAvatars() throws Exception {
if (expectedSubChannelName().isEmpty() && expectedSubChannelUrl().isEmpty()) { if (expectedSubChannelName().isEmpty() && expectedSubChannelUrl().isEmpty()) {
// this stream has no subchannel // this stream has no subchannel
assertEquals("", extractor().getSubChannelAvatarUrl()); assertEmpty(extractor().getSubChannelAvatars());
} else { } else {
// this stream has a subchannel // this stream has a subchannel
assertIsSecureUrl(extractor().getSubChannelAvatarUrl()); defaultTestImageCollection(extractor().getSubChannelAvatars());
} }
} }
@Test @Test
@Override @Override
public void testThumbnailUrl() throws Exception { public void testThumbnails() throws Exception {
assertIsSecureUrl(extractor().getThumbnailUrl()); defaultTestImageCollection(extractor().getThumbnails());
} }
@Test @Test