Fix MatchPhrasePrefixQueryBuilderTests#testPhraseOnFieldWithNoTerms

The test cannot run when no type is registered.

Relates #30450
This commit is contained in:
Jim Ferenczi 2018-06-05 08:52:29 +02:00
parent 5e48ba7cbd
commit 990442fdb7
1 changed files with 1 additions and 0 deletions

View File

@ -119,6 +119,7 @@ public class MatchPhrasePrefixQueryBuilderTests extends AbstractQueryTestCase<Ma
}
public void testPhraseOnFieldWithNoTerms() {
assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
MatchPhrasePrefixQueryBuilder matchQuery = new MatchPhrasePrefixQueryBuilder(DATE_FIELD_NAME, "three term phrase");
matchQuery.analyzer("whitespace");
expectThrows(IllegalArgumentException.class, () -> matchQuery.doToQuery(createShardContext()));