package org.schabi.newpipe.extractor.services.youtube; import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor; import java.util.Random; /** * Utility class for keeping YouTube tests stateless. */ public final class YoutubeTestsUtils { private YoutubeTestsUtils() { // No impl } /** * Clears static YT states. * *

* This method needs to be called to generate all mocks of a test when running different tests * at the same time. *

*/ public static void ensureStateless() { YoutubeParsingHelper.resetClientVersionAndKey(); YoutubeParsingHelper.setNumberGenerator(new Random(1)); YoutubeStreamExtractor.resetDeobfuscationCode(); } }