11package org .schabi .newpipe .extractor .services .youtube ;
22
3- import static org .junit .jupiter .api .Assertions .assertAll ;
4- import static org .junit .jupiter .api .Assertions .assertEquals ;
5- import static org .junit .jupiter .api .Assertions .assertFalse ;
6- import static org .junit .jupiter .api .Assertions .assertNotNull ;
7- import static org .junit .jupiter .api .Assertions .assertNull ;
8- import static org .junit .jupiter .api .Assertions .assertTrue ;
9- import static org .schabi .newpipe .downloader .DownloaderFactory .getMockPath ;
10-
113import com .grack .nanojson .JsonParser ;
124import com .grack .nanojson .JsonParserException ;
13-
145import org .junit .jupiter .api .Test ;
156import org .schabi .newpipe .extractor .localization .Localization ;
167import org .schabi .newpipe .extractor .localization .TimeAgoPatternsManager ;
2011
2112import java .io .FileInputStream ;
2213import java .io .FileNotFoundException ;
14+ import java .time .LocalDateTime ;
2315import java .time .OffsetDateTime ;
2416import java .time .ZoneOffset ;
17+ import java .util .TimeZone ;
2518
26- public class YoutubeStreamInfoItemTest {
19+ import static org .junit .jupiter .api .Assertions .assertAll ;
20+ import static org .junit .jupiter .api .Assertions .assertEquals ;
21+ import static org .junit .jupiter .api .Assertions .assertFalse ;
22+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
23+ import static org .junit .jupiter .api .Assertions .assertNull ;
24+ import static org .junit .jupiter .api .Assertions .assertTrue ;
25+ import static org .schabi .newpipe .downloader .DownloaderFactory .getMockPath ;
26+
27+ class YoutubeStreamInfoItemTest {
2728 @ Test
2829 void videoRendererPremiere () throws FileNotFoundException , JsonParserException {
2930 final var json = JsonParser .object ().from (new FileInputStream (getMockPath (
@@ -40,10 +41,14 @@ void videoRendererPremiere() throws FileNotFoundException, JsonParserException {
4041 () -> assertEquals ("https://www.youtube.com/channel/UCUPrbbdnot-aPgNM65svgOg" , extractor .getUploaderUrl ()),
4142 () -> assertFalse (extractor .getUploaderAvatars ().isEmpty ()),
4243 () -> assertTrue (extractor .isUploaderVerified ()),
43- () -> assertEquals ("2026-03-15 13:12" , extractor .getTextualUploadDate ()),
44+ () -> {
45+ TimeZone .setDefault (TimeZone .getTimeZone ("UTC" ));
46+ assertEquals ("2026-03-15 13:12" , extractor .getTextualUploadDate ());
47+ },
4448 () -> {
4549 assertNotNull (extractor .getUploadDate ());
46- assertEquals (OffsetDateTime .of (2026 , 3 , 15 , 13 , 12 , 0 , 0 , ZoneOffset .UTC ), extractor .getUploadDate ().offsetDateTime ());
50+ final var expected = LocalDateTime .of (2026 , 3 , 15 , 13 , 12 ).atOffset (ZoneOffset .UTC );
51+ assertEquals (expected , extractor .getUploadDate ().offsetDateTime ());
4752 },
4853 () -> assertEquals (-1 , extractor .getViewCount ()),
4954 () -> assertFalse (extractor .getThumbnails ().isEmpty ()),
0 commit comments