Skip to content

Commit 239df49

Browse files
committed
Fix some test source code
1 parent d59618d commit 239df49

2 files changed

Lines changed: 3 additions & 12 deletions

File tree

src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeStreamExtractorRestrictedTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.schabi.newpipe.extractor.services.youtube;
22

3-
import com.grack.nanojson.JsonParserException;
43
import org.junit.Before;
54
import org.junit.Ignore;
65
import org.junit.Test;

src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingExtractorTest.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import static org.junit.Assert.assertEquals;
3232
import static org.junit.Assert.assertNotNull;
3333
import static org.junit.Assert.assertTrue;
34+
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmptyErrors;
3435
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
3536

3637

@@ -68,21 +69,12 @@ public void testId() throws Exception {
6869
@Test
6970
public void testGetStreams() throws Exception {
7071
StreamInfoItemCollector collector = extractor.getStreams();
71-
if(!collector.getErrors().isEmpty()) {
72-
System.err.println("----------");
73-
for(Throwable e : collector.getErrors()) {
74-
e.printStackTrace();
75-
System.err.println("----------");
76-
}
77-
}
78-
assertTrue("no streams are received",
79-
!collector.getItemList().isEmpty()
80-
&& collector.getErrors().isEmpty());
72+
assertTrue("no streams are received", collector.getItemList().isEmpty());
8173
}
8274

8375
@Test
8476
public void testGetStreamsErrors() throws Exception {
85-
assertTrue("errors during stream list extraction", extractor.getStreams().getErrors().isEmpty());
77+
assertEmptyErrors("errors during stream list extraction", extractor.getStreams().getErrors());
8678
}
8779

8880
@Test

0 commit comments

Comments
 (0)