[TEST] return empty array if AbstractQueryTestCase#currentTypes is null

This is important to allow any test to use RandomQueryBuilder#createQuery()
since some of the query builders that are used in this test test the length
of the types array and otherwise will thow NPE if the test is not a subclass
of AbstractQueryTestCase.
This commit is contained in:
Simon Willnauer 2016-10-15 14:45:24 +02:00
parent 5a03eb91e6
commit 5137f44bd6
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>>
}
protected static String[] getCurrentTypes() {
return currentTypes;
return currentTypes == null ? Strings.EMPTY_ARRAY : currentTypes;
}
protected Collection<Class<? extends Plugin>> getPlugins() {