ToChildBlockJoinQueryBuilderTests.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
  3. * or more contributor license agreements. Licensed under the "Elastic License
  4. * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
  5. * Public License v 1"; you may not use this file except in compliance with, at
  6. * your election, the "Elastic License 2.0", the "GNU Affero General Public
  7. * License v3.0 only", or the "Server Side Public License, v 1".
  8. */
  9. package org.elasticsearch.index.query;
  10. import org.apache.lucene.search.Query;
  11. import org.apache.lucene.search.join.ToChildBlockJoinQuery;
  12. import org.elasticsearch.test.AbstractQueryTestCase;
  13. import java.io.IOException;
  14. import static org.hamcrest.CoreMatchers.instanceOf;
  15. public class ToChildBlockJoinQueryBuilderTests extends AbstractQueryTestCase<ToChildBlockJoinQueryBuilder> {
  16. @Override
  17. protected ToChildBlockJoinQueryBuilder doCreateTestQueryBuilder() {
  18. String filterFieldName = randomBoolean() ? KEYWORD_FIELD_NAME : TEXT_FIELD_NAME;
  19. return new ToChildBlockJoinQueryBuilder(QueryBuilders.termQuery(filterFieldName, randomAlphaOfLength(10)));
  20. }
  21. @Override
  22. protected void doAssertLuceneQuery(ToChildBlockJoinQueryBuilder queryBuilder, Query query, SearchExecutionContext context)
  23. throws IOException {
  24. assertThat(query, instanceOf(ToChildBlockJoinQuery.class));
  25. }
  26. @Override
  27. public void testUnknownField() throws IOException {
  28. // Test isn't relevant, since query is never parsed from xContent
  29. }
  30. @Override
  31. public void testUnknownObjectException() {
  32. // Test isn't relevant, since query is never parsed from xContent
  33. }
  34. @Override
  35. public void testFromXContent() throws IOException {
  36. // Test isn't relevant, since query is never parsed from xContent
  37. }
  38. @Override
  39. public void testValidOutput() {
  40. // Test isn't relevant, since query is never parsed from xContent
  41. }
  42. }