use of org.elasticsearch.search.suggest.completion.context.CategoryQueryContext in project elasticsearch by elastic.
the class CategoryQueryContextTests method testNullCategoryIsIllegal.
public void testNullCategoryIsIllegal() {
final CategoryQueryContext categoryQueryContext = randomCategoryQueryContext();
final CategoryQueryContext.Builder builder = CategoryQueryContext.builder().setBoost(categoryQueryContext.getBoost()).setPrefix(categoryQueryContext.isPrefix());
try {
builder.build();
fail("null category is illegal");
} catch (NullPointerException e) {
assertEquals(e.getMessage(), "category must not be null");
}
}
Aggregations