@@ -43,6 +43,8 @@ public abstract class DefaultStreamExtractorTest extends DefaultExtractorTest<St
4343 public abstract StreamType expectedStreamType ();
4444 public abstract String expectedUploaderName ();
4545 public abstract String expectedUploaderUrl ();
46+ public String expectedSubChannelName () { return "" ; } // default: there is no subchannel
47+ public String expectedSubChannelUrl () { return "" ; } // default: there is no subchannel
4648 public abstract List <String > expectedDescriptionContains (); // e.g. for full links
4749 public abstract long expectedLength ();
4850 public long expectedTimestamp () { return 0 ; } // default: there is no timestamp
@@ -92,6 +94,36 @@ public void testUploaderAvatarUrl() throws Exception {
9294 assertIsSecureUrl (extractor ().getUploaderAvatarUrl ());
9395 }
9496
97+ @ Test
98+ @ Override
99+ public void testSubChannelName () throws Exception {
100+ assertEquals (expectedSubChannelName (), extractor ().getSubChannelName ());
101+ }
102+
103+ @ Test
104+ @ Override
105+ public void testSubChannelUrl () throws Exception {
106+ final String subChannelUrl = extractor ().getSubChannelUrl ();
107+ assertEquals (expectedSubChannelUrl (), subChannelUrl );
108+
109+ if (!expectedSubChannelUrl ().isEmpty ()) {
110+ // this stream has a subchannel
111+ assertIsSecureUrl (subChannelUrl );
112+ }
113+ }
114+
115+ @ Test
116+ @ Override
117+ public void testSubChannelAvatarUrl () throws Exception {
118+ if (expectedSubChannelName ().isEmpty () && expectedSubChannelUrl ().isEmpty ()) {
119+ // this stream has no subchannel
120+ assertEquals ("" , extractor ().getSubChannelAvatarUrl ());
121+ } else {
122+ // this stream has a subchannel
123+ assertIsSecureUrl (extractor ().getSubChannelAvatarUrl ());
124+ }
125+ }
126+
95127 @ Test
96128 @ Override
97129 public void testThumbnailUrl () throws Exception {
0 commit comments