Skip to content

Commit 5931223

Browse files
committed
[YouTube] Improve YoutubeSuggestionExtractorTest
- Remove useless concatenation on the downloader path; - Remove unneeded public test modifier; - Update license header; - Specify the service class tested instead of the generic class.
1 parent e923fca commit 5931223

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
package org.schabi.newpipe.extractor.services.youtube;
2-
31
/*
42
* Created by Christian Schabesberger on 18.11.16.
53
*
64
* Copyright (C) Christian Schabesberger 2016 <chris.schabesberger@mailbox.org>
7-
* YoutubeSuggestionExtractorTest.java is part of NewPipe.
5+
* YoutubeSuggestionExtractorTest.java is part of NewPipe Extractor.
86
*
9-
* NewPipe is free software: you can redistribute it and/or modify
7+
* NewPipe Extractor is free software: you can redistribute it and/or modify
108
* it under the terms of the GNU General Public License as published by
119
* the Free Software Foundation, either version 3 of the License, or
1210
* (at your option) any later version.
1311
*
14-
* NewPipe is distributed in the hope that it will be useful,
12+
* NewPipe Extractor is distributed in the hope that it will be useful,
1513
* but WITHOUT ANY WARRANTY; without even the implied warranty of
1614
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1715
* GNU General Public License for more details.
1816
*
1917
* You should have received a copy of the GNU General Public License
20-
* along with NewPipe. If not, see <http://www.gnu.org/licenses/>.
18+
* along with NewPipe Extractor. If not, see <https://www.gnu.org/licenses/>.
2119
*/
2220

21+
package org.schabi.newpipe.extractor.services.youtube;
22+
2323
import static org.junit.jupiter.api.Assertions.assertFalse;
2424
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
2525

@@ -29,14 +29,15 @@
2929
import org.schabi.newpipe.extractor.NewPipe;
3030
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
3131
import org.schabi.newpipe.extractor.localization.Localization;
32+
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeSuggestionExtractor;
3233
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
3334

3435
import java.io.IOException;
3536

3637
/**
37-
* Test for {@link SuggestionExtractor}
38+
* Test for {@link YoutubeSuggestionExtractor}
3839
*/
39-
public class YoutubeSuggestionExtractorTest {
40+
class YoutubeSuggestionExtractorTest {
4041

4142
private static final String RESOURCE_PATH = DownloaderFactory.RESOURCE_PATH + "services/youtube/extractor/suggestions/";
4243

@@ -45,12 +46,12 @@ public class YoutubeSuggestionExtractorTest {
4546
@BeforeAll
4647
public static void setUp() throws Exception {
4748
YoutubeTestsUtils.ensureStateless();
48-
NewPipe.init(DownloaderFactory.getDownloader(RESOURCE_PATH + ""), new Localization("de", "DE"));
49+
NewPipe.init(DownloaderFactory.getDownloader(RESOURCE_PATH), new Localization("de", "DE"));
4950
suggestionExtractor = YouTube.getSuggestionExtractor();
5051
}
5152

5253
@Test
53-
public void testIfSuggestions() throws IOException, ExtractionException {
54+
void testIfSuggestions() throws IOException, ExtractionException {
5455
assertFalse(suggestionExtractor.suggestionList("hello").isEmpty());
5556
}
5657
}

0 commit comments

Comments
 (0)