3434import static org .schabi .newpipe .extractor .ExtractorAsserts .assertIsSecureUrl ;
3535import static org .schabi .newpipe .extractor .ExtractorAsserts .assertIsValidUrl ;
3636import static org .schabi .newpipe .extractor .services .DefaultTests .defaultTestListOfItems ;
37+ import static org .schabi .newpipe .extractor .stream .StreamExtractor .UNKNOWN_SUBSCRIBER_COUNT ;
3738
3839/**
3940 * Test for {@link StreamExtractor}
@@ -45,7 +46,7 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
4546 public abstract String expectedUploaderName ();
4647 public abstract String expectedUploaderUrl ();
4748 public boolean expectedUploaderVerified () { return false ; }
48- public long expectedUploaderSubscriberCountAtLeast () { return - 1 ; }
49+ public long expectedUploaderSubscriberCountAtLeast () { return UNKNOWN_SUBSCRIBER_COUNT ; }
4950 public String expectedSubChannelName () { return "" ; } // default: there is no subchannel
5051 public String expectedSubChannelUrl () { return "" ; } // default: there is no subchannel
5152 public boolean expectedDescriptionIsEmpty () { return false ; } // default: description is not empty
@@ -109,7 +110,11 @@ public void testUploaderVerified() throws Exception {
109110 @ Test
110111 @ Override
111112 public void testSubscriberCount () throws Exception {
112- assertGreaterOrEqual (expectedUploaderSubscriberCountAtLeast (), extractor ().getUploaderSubscriberCount ());
113+ if (expectedUploaderSubscriberCountAtLeast () == UNKNOWN_SUBSCRIBER_COUNT ) {
114+ assertEquals (UNKNOWN_SUBSCRIBER_COUNT , extractor ().getUploaderSubscriberCount ());
115+ } else {
116+ assertGreaterOrEqual (expectedUploaderSubscriberCountAtLeast (), extractor ().getUploaderSubscriberCount ());
117+ }
113118 }
114119
115120 @ Test
0 commit comments