Add requested changes.
This commit is contained in:
parent
d290d2e393
commit
5b0ec694a6
|
@ -207,11 +207,11 @@ public abstract class StreamExtractor extends Extractor {
|
|||
* The subscriber count of the uploader.
|
||||
* If the subscriber count is not implemented, or is unavailable, return <code>-1</code>.
|
||||
*
|
||||
* @return the subscriber count of the uploader or -1 if not available
|
||||
* @return the subscriber count of the uploader or {@value UNKNOWN_SUBSCRIBER_COUNT} if not available
|
||||
* @throws ParsingException
|
||||
*/
|
||||
public long getUploaderSubscriberCount() throws ParsingException {
|
||||
return -1;
|
||||
return UNKNOWN_SUBSCRIBER_COUNT;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,7 @@ import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEqualsOrderInd
|
|||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsValidUrl;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestListOfItems;
|
||||
import static org.schabi.newpipe.extractor.stream.StreamExtractor.UNKNOWN_SUBSCRIBER_COUNT;
|
||||
|
||||
/**
|
||||
* Test for {@link StreamExtractor}
|
||||
|
@ -45,7 +46,7 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
|
|||
public abstract String expectedUploaderName();
|
||||
public abstract String expectedUploaderUrl();
|
||||
public boolean expectedUploaderVerified() { return false; }
|
||||
public long expectedUploaderSubscriberCountAtLeast() { return -1; }
|
||||
public long expectedUploaderSubscriberCountAtLeast() { return UNKNOWN_SUBSCRIBER_COUNT; }
|
||||
public String expectedSubChannelName() { return ""; } // default: there is no subchannel
|
||||
public String expectedSubChannelUrl() { return ""; } // default: there is no subchannel
|
||||
public boolean expectedDescriptionIsEmpty() { return false; } // default: description is not empty
|
||||
|
@ -109,7 +110,11 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
|
|||
@Test
|
||||
@Override
|
||||
public void testSubscriberCount() throws Exception {
|
||||
assertGreaterOrEqual(expectedUploaderSubscriberCountAtLeast(), extractor().getUploaderSubscriberCount());
|
||||
if (expectedUploaderSubscriberCountAtLeast() == UNKNOWN_SUBSCRIBER_COUNT) {
|
||||
assertEquals(UNKNOWN_SUBSCRIBER_COUNT, extractor().getUploaderSubscriberCount());
|
||||
} else {
|
||||
assertGreaterOrEqual(expectedUploaderSubscriberCountAtLeast(), extractor().getUploaderSubscriberCount());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue