changed all == null || isEmpty() to isNullOrEmpty()
This commit is contained in:
@@ -8,6 +8,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmpty;
|
||||
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
||||
|
||||
public abstract class DefaultSearchExtractorTest extends DefaultListExtractorTest<SearchExtractor>
|
||||
implements BaseSearchExtractorTest {
|
||||
@@ -25,7 +26,7 @@ public abstract class DefaultSearchExtractorTest extends DefaultListExtractorTes
|
||||
@Override
|
||||
public void testSearchSuggestion() throws Exception {
|
||||
final String expectedSearchSuggestion = expectedSearchSuggestion();
|
||||
if (expectedSearchSuggestion == null || expectedSearchSuggestion.isEmpty()) {
|
||||
if (isNullOrEmpty(expectedSearchSuggestion)) {
|
||||
assertEmpty("Suggestion was expected to be empty", extractor().getSearchSuggestion());
|
||||
} else {
|
||||
assertEquals(expectedSearchSuggestion, extractor().getSearchSuggestion());
|
||||
|
||||
@@ -86,7 +86,7 @@ public final class DefaultTests {
|
||||
public static <T extends InfoItem> void assertNoMoreItems(ListExtractor<T> extractor) throws Exception {
|
||||
assertFalse("More items available when it shouldn't", extractor.hasNextPage());
|
||||
final String nextPageUrl = extractor.getNextPageUrl();
|
||||
assertTrue("Next page is not empty or null", nextPageUrl == null || nextPageUrl.isEmpty());
|
||||
assertTrue("Next page is not empty or null", isNullOrEmpty(nextPageUrl));
|
||||
}
|
||||
|
||||
public static void assertNoDuplicatedItems(StreamingService expectedService,
|
||||
|
||||
@@ -20,6 +20,7 @@ import static org.schabi.newpipe.extractor.ExtractorAsserts.assertEmptyErrors;
|
||||
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
||||
import static org.schabi.newpipe.extractor.services.DefaultTests.assertNoDuplicatedItems;
|
||||
import static org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeSearchQueryHandlerFactory.*;
|
||||
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
||||
|
||||
public class YoutubeSearchExtractorTest {
|
||||
public static class All extends DefaultSearchExtractorTest {
|
||||
@@ -170,7 +171,7 @@ public class YoutubeSearchExtractorTest {
|
||||
|
||||
assertFalse("More items available when it shouldn't", nextEmptyPage.hasNextPage());
|
||||
final String nextPageUrl = nextEmptyPage.getNextPageUrl();
|
||||
assertTrue("Next page is not empty or null", nextPageUrl == null || nextPageUrl.isEmpty());
|
||||
assertTrue("Next page is not empty or null", isNullOrEmpty(nextPageUrl));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user