diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeCommentsExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeCommentsExtractorTest.java index 9955fe1c3..2bcd4f594 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeCommentsExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeCommentsExtractorTest.java @@ -28,34 +28,39 @@ public class PeertubeCommentsExtractorTest { public static void setUp() throws Exception { NewPipe.init(DownloaderTestImpl.getInstance()); extractor = (PeertubeCommentsExtractor) PeerTube - .getCommentsExtractor("https://framatube.org/videos/watch/9c9de5e8-0a1e-484a-b099-e80766180a6d"); + .getCommentsExtractor("https://framatube.org/w/kkGMgK9ZtnKfYAgnEtQxbv"); } @Test - public void testGetComments() throws IOException, ExtractionException { + void testGetComments() throws IOException, ExtractionException { + final String comment = "I love this"; + InfoItemsPage comments = extractor.getInitialPage(); - boolean result = findInComments(comments, "Cool."); + boolean result = findInComments(comments, comment); while (comments.hasNextPage() && !result) { comments = extractor.getPage(comments.getNextPage()); - result = findInComments(comments, "Cool."); + result = findInComments(comments, comment); } assertTrue(result); } @Test - public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { - CommentsInfo commentsInfo = CommentsInfo.getInfo("https://framatube.org/videos/watch/217eefeb-883d-45be-b7fc-a788ad8507d3"); + void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { + final String comment = "great video"; + + final CommentsInfo commentsInfo = + CommentsInfo.getInfo("https://framatube.org/w/kkGMgK9ZtnKfYAgnEtQxbv"); assertEquals("Comments", commentsInfo.getName()); - boolean result = findInComments(commentsInfo.getRelatedItems(), "Cool"); + boolean result = findInComments(commentsInfo.getRelatedItems(), comment); Page nextPage = commentsInfo.getNextPage(); InfoItemsPage moreItems = new InfoItemsPage<>(null, nextPage, null); while (moreItems.hasNextPage() && !result) { moreItems = CommentsInfo.getMoreItems(PeerTube, commentsInfo, nextPage); - result = findInComments(moreItems.getItems(), "Cool"); + result = findInComments(moreItems.getItems(), comment); nextPage = moreItems.getNextPage(); } @@ -63,7 +68,7 @@ public class PeertubeCommentsExtractorTest { } @Test - public void testGetCommentsAllData() throws IOException, ExtractionException { + void testGetCommentsAllData() throws IOException, ExtractionException { InfoItemsPage comments = extractor.getInitialPage(); for (CommentsInfoItem c : comments.getItems()) { assertFalse(Utils.isBlank(c.getUploaderUrl())); @@ -105,13 +110,13 @@ public class PeertubeCommentsExtractorTest { } @Test - public void testGetComments() throws IOException, ExtractionException { + void testGetComments() throws IOException, ExtractionException { final InfoItemsPage comments = extractor.getInitialPage(); assertTrue(comments.getErrors().isEmpty()); } @Test - public void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { + void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { final CommentsInfo commentsInfo = CommentsInfo.getInfo("https://framatube.org/videos/watch/217eefeb-883d-45be-b7fc-a788ad8507d3"); assertTrue(commentsInfo.getErrors().isEmpty()); }