Skip to content

Commit 74f37d1

Browse files
authored
Restore GeoShapeWithDocValuesFieldMapperTests v7 test (#119147)
This test was removed with #112570 but needs to be added back with the read-only support for v7 indices.
1 parent 9167db4 commit 74f37d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ public void testDefaultConfiguration() throws IOException {
9191
assertTrue(fieldType.hasDocValues());
9292
}
9393

94+
public void testDefaultDocValueConfigurationOnPre7_8() throws IOException {
95+
IndexVersion oldVersion = IndexVersionUtils.randomVersionBetween(random(), IndexVersions.V_7_0_0, IndexVersions.V_7_7_0);
96+
DocumentMapper defaultMapper = createDocumentMapper(oldVersion, fieldMapping(this::minimalMapping));
97+
Mapper fieldMapper = defaultMapper.mappers().getMapper(FIELD_NAME);
98+
assertThat(fieldMapper, instanceOf(fieldMapperClass()));
99+
100+
GeoShapeWithDocValuesFieldMapper geoShapeFieldMapper = (GeoShapeWithDocValuesFieldMapper) fieldMapper;
101+
assertFalse(geoShapeFieldMapper.fieldType().hasDocValues());
102+
}
103+
94104
/**
95105
* Test that orientation parameter correctly parses
96106
*/

0 commit comments

Comments
 (0)