Browse Source

[TESTS] Fix expectations for GeoShapeQueryBuilderTests#testWrongFieldType

Relates #27730
Jim Ferenczi 7 years ago
parent
commit
b35c459c96

+ 1 - 0
core/src/test/java/org/elasticsearch/index/query/GeoShapeQueryBuilderTests.java

@@ -260,6 +260,7 @@ public class GeoShapeQueryBuilderTests extends AbstractQueryTestCase<GeoShapeQue
     }
 
     public void testWrongFieldType() throws IOException {
+        assumeTrue("test runs only when at least a type is registered", getCurrentTypes().length > 0);
         ShapeType shapeType = ShapeType.randomType(random());
         ShapeBuilder shape = RandomShapeGenerator.createShapeWithin(random(), null, shapeType);
         final GeoShapeQueryBuilder queryBuilder = new GeoShapeQueryBuilder(STRING_FIELD_NAME, shape);