|
7 | 7 | import org.schabi.newpipe.extractor.NewPipe; |
8 | 8 | import org.schabi.newpipe.extractor.exceptions.ParsingException; |
9 | 9 | import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCStreamExtractor; |
| 10 | +import org.schabi.newpipe.extractor.stream.AudioStream; |
| 11 | +import org.schabi.newpipe.extractor.stream.VideoStream; |
10 | 12 | import org.schabi.newpipe.extractor.utils.UtilsTest; |
11 | 13 |
|
12 | 14 | import java.text.ParseException; |
13 | 15 | import java.text.SimpleDateFormat; |
14 | 16 | import java.util.Calendar; |
| 17 | +import java.util.List; |
15 | 18 |
|
16 | 19 | import static java.util.Objects.requireNonNull; |
17 | 20 | import static junit.framework.TestCase.assertEquals; |
@@ -86,12 +89,20 @@ public void testUploaderAvatarUrl() throws Exception { |
86 | 89 |
|
87 | 90 | @Test |
88 | 91 | public void testVideoStreams() throws Exception { |
89 | | - assertEquals(4, extractor.getVideoStreams().size()); |
| 92 | + List<VideoStream> videoStreamList = extractor.getVideoStreams(); |
| 93 | + assertEquals(4, videoStreamList.size()); |
| 94 | + for (VideoStream stream : videoStreamList) { |
| 95 | + assertIsSecureUrl(stream.getUrl()); |
| 96 | + } |
90 | 97 | } |
91 | 98 |
|
92 | 99 | @Test |
93 | 100 | public void testAudioStreams() throws Exception { |
94 | | - assertEquals(2, extractor.getAudioStreams().size()); |
| 101 | + List<AudioStream> audioStreamList = extractor.getAudioStreams(); |
| 102 | + assertEquals(2, audioStreamList.size()); |
| 103 | + for (AudioStream stream : audioStreamList) { |
| 104 | + assertIsSecureUrl(stream.getUrl()); |
| 105 | + } |
95 | 106 | } |
96 | 107 |
|
97 | 108 | @Test |
@@ -164,12 +175,20 @@ public void testUploaderAvatarUrl() throws Exception { |
164 | 175 |
|
165 | 176 | @Test |
166 | 177 | public void testVideoStreams() throws Exception { |
167 | | - assertEquals(8, extractor.getVideoStreams().size()); |
| 178 | + List<VideoStream> videoStreamList = extractor.getVideoStreams(); |
| 179 | + assertEquals(8, videoStreamList.size()); |
| 180 | + for (VideoStream stream : videoStreamList) { |
| 181 | + assertIsSecureUrl(stream.getUrl()); |
| 182 | + } |
168 | 183 | } |
169 | 184 |
|
170 | 185 | @Test |
171 | 186 | public void testAudioStreams() throws Exception { |
172 | | - assertEquals(2, extractor.getAudioStreams().size()); |
| 187 | + List<AudioStream> audioStreamList = extractor.getAudioStreams(); |
| 188 | + assertEquals(2, audioStreamList.size()); |
| 189 | + for (AudioStream stream : audioStreamList) { |
| 190 | + assertIsSecureUrl(stream.getUrl()); |
| 191 | + } |
173 | 192 | } |
174 | 193 |
|
175 | 194 | @Test |
|
0 commit comments