Skip to content

Commit c314885

Browse files
litetexStypox
andcommitted
Init in setup
Co-Authored-By: Stypox <stypox@pm.me>
1 parent ca8fc68 commit c314885

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/peertube/PeertubeCommentsExtractorTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import static org.schabi.newpipe.extractor.ServiceList.PeerTube;
77
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestImageCollection;
88

9+
import org.junit.jupiter.api.BeforeAll;
910
import org.junit.jupiter.api.Test;
1011
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
1112
import org.schabi.newpipe.extractor.Page;
@@ -122,6 +123,14 @@ void testGetCommentsFromCommentsInfo() throws IOException, ExtractionException {
122123
public static class NestedComments extends DefaultSimpleExtractorTest<PeertubeCommentsExtractor> {
123124
private InfoItemsPage<CommentsInfoItem> comments = null;
124125

126+
@BeforeAll
127+
@Override
128+
public void setUp() throws Exception {
129+
super.setUp();
130+
131+
extractor(); // Initialize
132+
}
133+
125134
@Override
126135
protected PeertubeCommentsExtractor createExtractor() throws Exception {
127136
return (PeertubeCommentsExtractor) PeerTube
@@ -135,7 +144,6 @@ protected void fetchExtractor(final PeertubeCommentsExtractor extractor) throws
135144

136145
@Test
137146
void testGetComments() throws IOException, ExtractionException {
138-
extractor(); // Init
139147
assertFalse(comments.getItems().isEmpty());
140148
final Optional<CommentsInfoItem> nestedCommentHeadOpt =
141149
findCommentWithId("34293", comments.getItems());
@@ -151,7 +159,6 @@ void testHasCreatorReply() {
151159
}
152160

153161
private void assertCreatorReply(final String id, final boolean expected) {
154-
extractor(); // Init
155162
final Optional<CommentsInfoItem> comment =
156163
findCommentWithId(id, comments.getItems());
157164
assertTrue(comment.isPresent());

0 commit comments

Comments
 (0)