Search in sources :

Example 1 with CategoryQueryContext

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");
    }
}
Also used : CategoryQueryContext(org.elasticsearch.search.suggest.completion.context.CategoryQueryContext)

Aggregations

CategoryQueryContext (org.elasticsearch.search.suggest.completion.context.CategoryQueryContext)1