Skip to content

Commit 64f6b04

Browse files
authored
Merge pull request #545 from XiangRongLin/comment_reset
Add comment explaining YoutubeParsingHelper.resetClientVersionAndKey
2 parents 84380e4 + 26d50ac commit 64f6b04

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeParsingHelper.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,19 @@ public static String getKey() throws IOException, ExtractionException {
358358
}
359359

360360
/**
361-
* Only use in tests.
361+
* <p>
362+
* <b>Only use in tests.</b>
363+
* </p>
362364
*
365+
* <p>
363366
* Quick-and-dirty solution to reset global state in between test classes.
367+
* </p>
368+
* <p>
369+
* This is needed for the mocks because in order to reach that state a network request has to
370+
* be made. If the global state is not reset and the RecordingDownloader is used,
371+
* then only the first test class has that request recorded. Meaning running the other
372+
* tests with mocks will fail, because the mock is missing.
373+
* </p>
364374
*/
365375
public static void resetClientVersionAndKey() {
366376
clientVersion = null;

0 commit comments

Comments
 (0)