66import static org .schabi .newpipe .extractor .ServiceList .PeerTube ;
77import static org .schabi .newpipe .extractor .services .DefaultTests .defaultTestImageCollection ;
88
9+ import org .junit .jupiter .api .BeforeAll ;
910import org .junit .jupiter .api .Test ;
1011import org .schabi .newpipe .extractor .ListExtractor .InfoItemsPage ;
1112import 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