diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 146bf5c3e..b55d66068 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up JDK 8 + - name: set up JDK 11 uses: actions/setup-java@v3 with: - java-version: '8' + java-version: '11' distribution: 'temurin' - name: Cache Gradle dependencies 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 72382813a..f7f045a26 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 @@ -48,7 +48,7 @@ public class PeertubeCommentsExtractorTest { @Test void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException { - final String comment = "great video"; + final String comment = "Thanks for creating such an informative video"; final CommentsInfo commentsInfo = CommentsInfo.getInfo("https://framatube.org/w/kkGMgK9ZtnKfYAgnEtQxbv"); @@ -69,33 +69,33 @@ public class PeertubeCommentsExtractorTest { @Test void testGetCommentsAllData() throws IOException, ExtractionException { - InfoItemsPage comments = extractor.getInitialPage(); - for (CommentsInfoItem c : comments.getItems()) { - assertFalse(Utils.isBlank(c.getUploaderUrl())); - assertFalse(Utils.isBlank(c.getUploaderName())); - assertFalse(Utils.isBlank(c.getUploaderAvatarUrl())); - assertFalse(Utils.isBlank(c.getCommentId())); - assertFalse(Utils.isBlank(c.getCommentText().getContent())); - assertFalse(Utils.isBlank(c.getName())); - assertFalse(Utils.isBlank(c.getTextualUploadDate())); - assertFalse(Utils.isBlank(c.getThumbnailUrl())); - assertFalse(Utils.isBlank(c.getUrl())); - assertEquals(-1, c.getLikeCount()); - assertTrue(Utils.isBlank(c.getTextualLikeCount())); - } + extractor.getInitialPage() + .getItems() + .forEach(commentsInfoItem -> { + assertFalse(Utils.isBlank(commentsInfoItem.getUploaderUrl())); + assertFalse(Utils.isBlank(commentsInfoItem.getUploaderName())); + assertFalse(Utils.isBlank(commentsInfoItem.getUploaderAvatarUrl())); + assertFalse(Utils.isBlank(commentsInfoItem.getCommentId())); + assertFalse(Utils.isBlank(commentsInfoItem.getCommentText().getContent())); + assertFalse(Utils.isBlank(commentsInfoItem.getName())); + assertFalse(Utils.isBlank(commentsInfoItem.getTextualUploadDate())); + assertFalse(Utils.isBlank(commentsInfoItem.getThumbnailUrl())); + assertFalse(Utils.isBlank(commentsInfoItem.getUrl())); + assertEquals(-1, commentsInfoItem.getLikeCount()); + assertTrue(Utils.isBlank(commentsInfoItem.getTextualLikeCount())); + }); } - private boolean findInComments(InfoItemsPage comments, String comment) { + private boolean findInComments(final InfoItemsPage comments, + final String comment) { return findInComments(comments.getItems(), comment); } - private boolean findInComments(List comments, String comment) { - for (CommentsInfoItem c : comments) { - if (c.getCommentText().getContent().contains(comment)) { - return true; - } - } - return false; + private boolean findInComments(final List comments, + final String comment) { + return comments.stream() + .anyMatch(commentsInfoItem -> + commentsInfoItem.getCommentText().getContent().contains(comment)); } }