[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:
parent
5a03eb91e6
commit
5137f44bd6
|
@ -159,7 +159,7 @@ public abstract class AbstractQueryTestCase<QB extends AbstractQueryBuilder<QB>>
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String[] getCurrentTypes() {
|
protected static String[] getCurrentTypes() {
|
||||||
return currentTypes;
|
return currentTypes == null ? Strings.EMPTY_ARRAY : currentTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Collection<Class<? extends Plugin>> getPlugins() {
|
protected Collection<Class<? extends Plugin>> getPlugins() {
|
||||||
|
|
Loading…
Reference in New Issue