Skip to content

Commit

Permalink
Remove Failing and Outdated GeoTile BwC Test
Browse files Browse the repository at this point in the history
This test is failing randomly since it tests outdated BwC
that was removed in elastic#62072.
  • Loading branch information
original-brownbear committed Sep 24, 2020
1 parent 225e82f commit cd00618
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,12 @@

package org.elasticsearch.search.aggregations.bucket.composite;

import org.elasticsearch.Version;
import org.elasticsearch.common.geo.GeoBoundingBox;
import org.elasticsearch.common.geo.GeoBoundingBoxTests;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.VersionUtils;

import java.io.IOException;
import java.util.Collections;

import static org.hamcrest.Matchers.equalTo;

public class GeoTileGridValuesSourceBuilderTests extends ESTestCase {

public void testSetFormat() {
CompositeValuesSourceBuilder<?> builder = new GeoTileGridValuesSourceBuilder("name");
expectThrows(IllegalArgumentException.class, () -> builder.format("format"));
}

public void testBWCBounds() throws IOException {
Version noBoundsSupportVersion = VersionUtils.randomVersionBetween(random(), Version.V_7_0_0, Version.V_7_5_0);
GeoTileGridValuesSourceBuilder builder = new GeoTileGridValuesSourceBuilder("name");
if (randomBoolean()) {
builder.geoBoundingBox(GeoBoundingBoxTests.randomBBox());
}
try (BytesStreamOutput output = new BytesStreamOutput()) {
output.setVersion(Version.V_7_6_0);
builder.writeTo(output);
try (StreamInput in = new NamedWriteableAwareStreamInput(output.bytes().streamInput(),
new NamedWriteableRegistry(Collections.emptyList()))) {
in.setVersion(noBoundsSupportVersion);
GeoTileGridValuesSourceBuilder readBuilder = new GeoTileGridValuesSourceBuilder(in);
assertThat(readBuilder.geoBoundingBox(), equalTo(new GeoBoundingBox(
new GeoPoint(Double.NaN, Double.NaN), new GeoPoint(Double.NaN, Double.NaN))));
}
}
}
}

0 comments on commit cd00618

Please sign in to comment.