Skip to content

Commit 2659621

Browse files
committed
Refactored MediaCCCRecentListExtractorTest
1 parent 53962bf commit 2659621

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

extractor/src/test/java/org/schabi/newpipe/extractor/services/media_ccc/MediaCCCRecentListExtractorTest.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package org.schabi.newpipe.extractor.services.media_ccc;
22

3+
import static org.junit.jupiter.api.Assertions.assertAll;
4+
import static org.junit.jupiter.api.Assertions.assertFalse;
5+
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertGreater;
6+
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
7+
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
8+
39
import org.junit.jupiter.api.BeforeAll;
410
import org.junit.jupiter.api.Test;
511
import org.junit.jupiter.api.function.Executable;
@@ -8,15 +14,9 @@
814
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
915
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
1016

11-
import java.util.ArrayList;
1217
import java.util.List;
13-
import java.util.stream.Collectors;
1418
import java.util.stream.Stream;
1519

16-
import static org.junit.jupiter.api.Assertions.*;
17-
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
18-
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
19-
2020
public class MediaCCCRecentListExtractorTest {
2121
private static KioskExtractor extractor;
2222

@@ -37,9 +37,14 @@ void testStreamList() throws Exception {
3737

3838
private Stream<Executable> getAllConditionsForItem(final StreamInfoItem item) {
3939
return Stream.of(
40-
() -> assertFalse(isNullOrEmpty(item.getName())),
41-
() -> assertTrue(item.getDuration() > 0,
42-
"Duration[=" + item.getDuration() + "] of " + item + "is <= 0")
40+
() -> assertFalse(
41+
isNullOrEmpty(item.getName()),
42+
"Name=[" + item.getName() + "] of " + item + " is empty or null"
43+
),
44+
() -> assertGreater(0,
45+
item.getDuration(),
46+
"Duration[=" + item.getDuration() + "] of " + item + " is <= 0"
47+
)
4348
);
4449
}
4550
}

0 commit comments

Comments
 (0)