Skip to content

Commit 5c83409

Browse files
StypoxAudricV
authored andcommitted
[YouTube] Rewrite manifest test and rename long methods
1 parent 8226fd0 commit 5c83409

3 files changed

Lines changed: 290 additions & 565 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public final class YoutubeDashManifestCreator {
7979
*
8080
* <p>
8181
* This list is automatically cleared in the execution of
82-
* {@link #createDashManifestFromOtfStreamingUrl(String, ItagItem, long)}, before the DASH
82+
* {@link #fromOtfStreamingUrl(String, ItagItem, long)}, before the DASH
8383
* manifest is converted to a string.
8484
* </p>
8585
*/
@@ -90,7 +90,7 @@ public final class YoutubeDashManifestCreator {
9090
*
9191
* <p>
9292
* This list is automatically cleared in the execution of
93-
* {@link #createDashManifestFromOtfStreamingUrl(String, ItagItem, long)}, before the DASH
93+
* {@link #fromOtfStreamingUrl(String, ItagItem, long)}, before the DASH
9494
* manifest is converted to a string.
9595
* </p>
9696
*/
@@ -242,7 +242,7 @@ public static final class YoutubeDashManifestCreationException extends Exception
242242
* the DASH manifest
243243
*/
244244
@Nonnull
245-
public static String createDashManifestFromOtfStreamingUrl(
245+
public static String fromOtfStreamingUrl(
246246
@Nonnull final String otfBaseStreamingUrl,
247247
@Nonnull final ItagItem itagItem,
248248
final long durationSecondsFallback) throws YoutubeDashManifestCreationException {
@@ -376,7 +376,7 @@ public static String createDashManifestFromOtfStreamingUrl(
376376
* the DASH manifest
377377
*/
378378
@Nonnull
379-
public static String createDashManifestFromPostLiveStreamDvrStreamingUrl(
379+
public static String fromPostLiveStreamDvrStreamingUrl(
380380
@Nonnull final String postLiveStreamDvrStreamingUrl,
381381
@Nonnull final ItagItem itagItem,
382382
final int targetDurationSec,
@@ -505,7 +505,7 @@ public static String createDashManifestFromPostLiveStreamDvrStreamingUrl(
505505
* the DASH manifest
506506
*/
507507
@Nonnull
508-
public static String createDashManifestFromProgressiveStreamingUrl(
508+
public static String fromProgressiveStreamingUrl(
509509
@Nonnull final String progressiveStreamingBaseUrl,
510510
@Nonnull final ItagItem itagItem,
511511
final long durationSecondsFallback) throws YoutubeDashManifestCreationException {

extractor/src/test/java/org/schabi/newpipe/extractor/ExtractorAsserts.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import static org.junit.jupiter.api.Assertions.assertNull;
1616
import static org.junit.jupiter.api.Assertions.assertTrue;
1717

18+
import org.schabi.newpipe.extractor.utils.Utils;
19+
1820
public class ExtractorAsserts {
1921
public static void assertEmptyErrors(String message, List<Throwable> errors) {
2022
if (!errors.isEmpty()) {
@@ -64,6 +66,14 @@ public static void assertEmpty(@Nullable String message, String stringToCheck) {
6466
}
6567
}
6668

69+
public static void assertNotBlank(String stringToCheck) {
70+
assertNotBlank(stringToCheck, null);
71+
}
72+
73+
public static void assertNotBlank(String stringToCheck, @Nullable String message) {
74+
assertFalse(Utils.isBlank(stringToCheck), message);
75+
}
76+
6777
public static void assertGreater(final long expected, final long actual) {
6878
assertGreater(expected, actual, actual + " is not > " + expected);
6979
}

0 commit comments

Comments
 (0)