|
19 | 19 |
|
20 | 20 | package org.elasticsearch.search.aggregations.bucket.composite;
|
21 | 21 |
|
22 |
| -import org.elasticsearch.Version; |
23 |
| -import org.elasticsearch.common.geo.GeoBoundingBox; |
24 |
| -import org.elasticsearch.common.geo.GeoBoundingBoxTests; |
25 |
| -import org.elasticsearch.common.geo.GeoPoint; |
26 |
| -import org.elasticsearch.common.io.stream.BytesStreamOutput; |
27 |
| -import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput; |
28 |
| -import org.elasticsearch.common.io.stream.NamedWriteableRegistry; |
29 |
| -import org.elasticsearch.common.io.stream.StreamInput; |
30 | 22 | import org.elasticsearch.test.ESTestCase;
|
31 |
| -import org.elasticsearch.test.VersionUtils; |
32 |
| - |
33 |
| -import java.io.IOException; |
34 |
| -import java.util.Collections; |
35 |
| - |
36 |
| -import static org.hamcrest.Matchers.equalTo; |
37 | 23 |
|
38 | 24 | public class GeoTileGridValuesSourceBuilderTests extends ESTestCase {
|
39 | 25 |
|
40 | 26 | public void testSetFormat() {
|
41 | 27 | CompositeValuesSourceBuilder<?> builder = new GeoTileGridValuesSourceBuilder("name");
|
42 | 28 | expectThrows(IllegalArgumentException.class, () -> builder.format("format"));
|
43 | 29 | }
|
44 |
| - |
45 |
| - public void testBWCBounds() throws IOException { |
46 |
| - Version noBoundsSupportVersion = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.V_7_5_0); |
47 |
| - GeoTileGridValuesSourceBuilder builder = new GeoTileGridValuesSourceBuilder("name"); |
48 |
| - if (randomBoolean()) { |
49 |
| - builder.geoBoundingBox(GeoBoundingBoxTests.randomBBox()); |
50 |
| - } |
51 |
| - try (BytesStreamOutput output = new BytesStreamOutput()) { |
52 |
| - output.setVersion(Version.V_7_6_0); |
53 |
| - builder.writeTo(output); |
54 |
| - try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(), |
55 |
| - new NamedWriteableRegistry(Collections.emptyList()))) { |
56 |
| - in.setVersion(noBoundsSupportVersion); |
57 |
| - GeoTileGridValuesSourceBuilder readBuilder = new GeoTileGridValuesSourceBuilder(in); |
58 |
| - assertThat(readBuilder.geoBoundingBox(), equalTo(new GeoBoundingBox( |
59 |
| - new GeoPoint(Double.NaN, Double.NaN), new GeoPoint(Double.NaN, Double.NaN)))); |
60 |
| - } |
61 |
| - } |
62 |
| - } |
63 | 30 | }
|
0 commit comments