Skip to content

Commit 1172d8c

Browse files
committed
Fix test being not static and not executed
1 parent 24dedd9 commit 1172d8c

5 files changed

Lines changed: 985 additions & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void testGetCommentsAllData() throws IOException, ExtractionException {
159159

160160
}
161161

162-
public class HeartedByCreator implements InitYoutubeTest {
162+
public static class HeartedByCreator implements InitYoutubeTest {
163163
private final static String url = "https://www.youtube.com/watch?v=tR11b7uh17Y";
164164
private YoutubeCommentsExtractor extractor;
165165

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"request": {
3+
"httpMethod": "GET",
4+
"url": "https://www.youtube.com/sw.js",
5+
"headers": {
6+
"Referer": [
7+
"https://www.youtube.com"
8+
],
9+
"Origin": [
10+
"https://www.youtube.com"
11+
],
12+
"Accept-Language": [
13+
"en-GB, en;q\u003d0.9"
14+
]
15+
},
16+
"localization": {
17+
"languageCode": "en",
18+
"countryCode": "GB"
19+
}
20+
},
21+
"response": {
22+
"responseCode": 200,
23+
"responseMessage": "",
24+
"responseHeaders": {
25+
"access-control-allow-credentials": [
26+
"true"
27+
],
28+
"access-control-allow-origin": [
29+
"https://www.youtube.com"
30+
],
31+
"alt-svc": [
32+
"h3\u003d\":443\"; ma\u003d2592000,h3-29\u003d\":443\"; ma\u003d2592000"
33+
],
34+
"cache-control": [
35+
"private, max-age\u003d0"
36+
],
37+
"content-security-policy": [
38+
"require-trusted-types-for \u0027script\u0027"
39+
],
40+
"content-type": [
41+
"text/javascript; charset\u003dutf-8"
42+
],
43+
"cross-origin-opener-policy": [
44+
"same-origin; report-to\u003d\"youtube_main\""
45+
],
46+
"date": [
47+
"Sat, 12 Jul 2025 12:10:36 GMT"
48+
],
49+
"document-policy": [
50+
"include-js-call-stacks-in-crash-reports"
51+
],
52+
"expires": [
53+
"Sat, 12 Jul 2025 12:10:36 GMT"
54+
],
55+
"origin-trial": [
56+
"AmhMBR6zCLzDDxpW+HfpP67BqwIknWnyMOXOQGfzYswFmJe+fgaI6XZgAzcxOrzNtP7hEDsOo1jdjFnVr2IdxQ4AAAB4eyJvcmlnaW4iOiJodHRwczovL3lvdXR1YmUuY29tOjQ0MyIsImZlYXR1cmUiOiJXZWJWaWV3WFJlcXVlc3RlZFdpdGhEZXByZWNhdGlvbiIsImV4cGlyeSI6MTc1ODA2NzE5OSwiaXNTdWJkb21haW4iOnRydWV9"
57+
],
58+
"p3p": [
59+
"CP\u003d\"This is not a P3P policy! See http://support.google.com/accounts/answer/151657?hl\u003den-GB for more info.\""
60+
],
61+
"permissions-policy": [
62+
"ch-ua-arch\u003d*, ch-ua-bitness\u003d*, ch-ua-full-version\u003d*, ch-ua-full-version-list\u003d*, ch-ua-model\u003d*, ch-ua-wow64\u003d*, ch-ua-form-factors\u003d*, ch-ua-platform\u003d*, ch-ua-platform-version\u003d*"
63+
],
64+
"report-to": [
65+
"{\"group\":\"youtube_main\",\"max_age\":2592000,\"endpoints\":[{\"url\":\"https://csp.withgoogle.com/csp/report-to/youtube_main\"}]}"
66+
],
67+
"reporting-endpoints": [
68+
"default\u003d\"/web-reports?context\u003deJwNz29MzHEcB3Dfew91v-t-v8-XDTGdNCxdO6fLv8qE0EhtbK1w15-7SlfHuTtX4xlttmYsooT1pIzJn1mTigce-P9nJX9LpnGzhTwQq3Q-D16PPu_3Pp-P_tPUPlO5SHVXiNJwhYjbXCmuH94vdi32imCNV2x8cUDUZvjEaItPXO30iWFTQOTHBsTZvoC4-CEg3INBMT4UFBe0XJ0rOlcXZI55ubrOPD1cLj1-N-jxq1-Pqp965C9VYEhUoDFi5UkKejMVDGcpaG9V0HlTwUBIgT_fgBGHATa_AZ5RA75lR6G7IQo9vVFI2GFESq0RlzqMyH5gxElWMmHEj39GJKeqaNukIuBUoQRUNB5TseyMiqEGFRHNKmY9VtEdpyG0TkOEQ4Oe2U5r6DmnYfo1DTlPNTQ903D-i4b-PxrWjGnYPYPgjyd0JREcNkLyakJ1KuHIWkLTTsKAnbCthHCjjFC0l9BcRRipJhw6xBlWcJS7tYTnLP044WcdwXqKkFZP6G8hfGwl3LtMiLlCmNtG2N7OudsED5u4QwjfJUQ-JChPeP9LgnxFePeOkDdICLHXIcK8b4Qfw4TPfwmGMYKRSTaTzWbRbD4zsTi2iMWzBGZhVpbMVrIUlsbS2QZWOs5_TPB9kwRbmHBiioQiJEI6CWOkRMUciZFoiY65Ek0xEpEmiU0LJN6yr7ES3Usk6uMlggkS1uUSNtbI8m0S31dJTK6WWJgi0bpeojpD4hZ7z8xbJMKZEnlbJfawQlbMXMzNPMzLAqyadWVJnN8uUZPDM7vEgRKJcab3S0gloqv50f1p2vW6N3tjzVUev89f6Ew86Cw0u7yeSp_ZWVlsLvKW-cqKCtx2q8Vqs6ywrEpcZrHvs_wH1tXjAQ\""
69+
],
70+
"server": [
71+
"ESF"
72+
],
73+
"set-cookie": [
74+
"YSC\u003dGorz_CRC4FY; Domain\u003d.youtube.com; Path\u003d/; Secure; HttpOnly; SameSite\u003dnone",
75+
"VISITOR_INFO1_LIVE\u003d; Domain\u003d.youtube.com; Expires\u003dSun, 16-Oct-2022 12:10:36 GMT; Path\u003d/; Secure; HttpOnly; SameSite\u003dnone"
76+
],
77+
"strict-transport-security": [
78+
"max-age\u003d31536000"
79+
],
80+
"x-content-type-options": [
81+
"nosniff"
82+
],
83+
"x-frame-options": [
84+
"SAMEORIGIN"
85+
],
86+
"x-xss-protection": [
87+
"0"
88+
]
89+
},
90+
"responseBody": "\n self.addEventListener(\u0027install\u0027, event \u003d\u003e {\n event.waitUntil(self.skipWaiting());\n });\n self.addEventListener(\u0027activate\u0027, event \u003d\u003e {\n event.waitUntil(\n self.clients.claim().then(() \u003d\u003e self.registration.unregister()));\n });\n ",
91+
"latestUrl": "https://www.youtube.com/sw.js"
92+
}
93+
}

extractor/src/test/resources/mocks/v1/org/schabi/newpipe/extractor/services/youtube/youtubecommentsextractor/heartedbycreator/generated_mock_1.json

Lines changed: 89 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)