Skip to content

Commit

Permalink
Rename testDoNotAcceptNonURLs() -> assertDoNotAcceptNonURLs()
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiGr committed Dec 29, 2023
1 parent 9d66deb commit 9ab932e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static org.junit.jupiter.api.Assertions.*;
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs;

/**
* Test for {@link PeertubeChannelLinkHandlerFactory}
Expand All @@ -34,7 +34,7 @@ public void acceptUrlTest() throws ParsingException {
assertTrue(linkHandler.acceptUrl("https://peertube.stream/c/kranti_channel@videos.squat.net/videos"));
assertTrue(linkHandler.acceptUrl("https://peertube.stream/api/v1/video-channels/7682d9f2-07be-4622-862e-93ec812e2ffa"));

testDoNotAcceptNonURLs(linkHandler);
assertDoNotAcceptNonURLs(linkHandler);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs;

/**
* Test for {@link PeertubeCommentsLinkHandlerFactory}
Expand All @@ -33,7 +33,7 @@ public void acceptUrlTest() throws ParsingException {
assertTrue(linkHandler.acceptUrl("https://framatube.org/w/9c9de5e8-0a1e-484a-b099-e80766180a6d"));
assertTrue(linkHandler.acceptUrl("https://framatube.org/api/v1/videos/9c9de5e8-0a1e-484a-b099-e80766180a6d/comment-threads?start=0&count=10&sort=-createdAt"));

testDoNotAcceptNonURLs(linkHandler);
assertDoNotAcceptNonURLs(linkHandler);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class PeertubeLinkHandlerFactoryTestHelper {

public static void testDoNotAcceptNonURLs(LinkHandlerFactory linkHandler)
public static void assertDoNotAcceptNonURLs(LinkHandlerFactory linkHandler)
throws ParsingException {
assertFalse(linkHandler.acceptUrl("orchestr/a/"));
assertFalse(linkHandler.acceptUrl("/a/"));
Expand All @@ -23,7 +23,7 @@ public static void testDoNotAcceptNonURLs(LinkHandlerFactory linkHandler)
assertFalse(linkHandler.acceptUrl("986513"));
}

public static void testDoNotAcceptNonURLs(ListLinkHandlerFactory linkHandler)
public static void assertDoNotAcceptNonURLs(ListLinkHandlerFactory linkHandler)
throws ParsingException {
assertFalse(linkHandler.acceptUrl("orchestr/a/"));
assertFalse(linkHandler.acceptUrl("/a/"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs;

/**
* Test for {@link PeertubePlaylistLinkHandlerFactory}
Expand All @@ -35,7 +35,7 @@ void acceptUrlTest() throws ParsingException {
assertTrue(linkHandler.acceptUrl("https://framatube.org/videos/watch/playlist/96b0ee2b-a5a7-4794-8769-58d8ccb79ab7"));
assertTrue(linkHandler.acceptUrl("https://framatube.org/w/p/96b0ee2b-a5a7-4794-8769-58d8ccb79ab7"));

testDoNotAcceptNonURLs(linkHandler);
assertDoNotAcceptNonURLs(linkHandler);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static org.junit.jupiter.api.Assertions.*;
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs;

/**
* Test for {@link PeertubeStreamLinkHandlerFactory}
Expand Down Expand Up @@ -73,6 +73,6 @@ public void testAcceptUrl() throws ParsingException {
assertFalse(linkHandler.acceptUrl("https://framatube.org/w/p/dacdc4ef-5160-4846-9b70-a655880da667"));
assertFalse(linkHandler.acceptUrl("https://framatube.org/videos/watch/playlist/dacdc4ef-5160-4846-9b70-a655880da667"));

PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs(linkHandler);
PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs(linkHandler);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs;
import static org.schabi.newpipe.extractor.services.peertube.PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs;

/**
* Test for {@link PeertubeTrendingLinkHandlerFactory}
Expand Down Expand Up @@ -59,6 +59,6 @@ public void acceptUrl() throws ParsingException {
assertTrue(LinkHandlerFactory.acceptUrl("https://peertube.mastodon.host/videos/local"));
assertTrue(LinkHandlerFactory.acceptUrl("https://peertube.mastodon.host/videos/local?adsf=fjaj#fhe"));

PeertubeLinkHandlerFactoryTestHelper.testDoNotAcceptNonURLs(LinkHandlerFactory);
PeertubeLinkHandlerFactoryTestHelper.assertDoNotAcceptNonURLs(LinkHandlerFactory);
}
}

0 comments on commit 9ab932e

Please sign in to comment.