Skip to content

Commit fd1ef72

Browse files
committed
Update license tests to assert functions now work in release build
1 parent d8d58c9 commit fd1ef72

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/spatial/SpatialGridLicenseTestCase.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ protected int precision() {
6363
/**
6464
* Test that the geo_grid functions are disabled outside of SNAPSHOT.
6565
*/
66-
public void testGeoGridDisabled() {
67-
assertGeoGridDisabledWith("index_geo_point");
66+
public void testGeoGridEnabled() {
67+
assertGeoGridEnabled();
6868
}
6969

7070
/**
@@ -120,16 +120,10 @@ protected void assertGeoGridFailsWith(String index) {
120120
assertThat(e.getMessage(), containsString(expectedError));
121121
}
122122

123-
protected void assertGeoGridDisabledWith(String index) {
124-
assumeFalse("testing feature is disabled in non-snapshot builds", Build.current().isSnapshot());
125-
var query = String.format(Locale.ROOT, """
126-
FROM %s
127-
| EVAL gridId = %s(location, %d)
128-
| STATS count=COUNT() BY gridId
129-
""", index, gridFunction(), precision());
130-
var expectedError = String.format(Locale.ROOT, "Unknown function [%s]", gridFunction());
131-
ElasticsearchException e = expectThrows(VerificationException.class, () -> run(query));
132-
assertThat(e.getMessage(), containsString(expectedError));
123+
protected void assertGeoGridEnabled() {
124+
assumeFalse("testing feature is enabled in non-snapshot builds", Build.current().isSnapshot());
125+
assertThat("Capability SPATIAL_GRID_TYPES should be enabled", EsqlCapabilities.Cap.SPATIAL_GRID_TYPES.isEnabled(), equalTo(true));
126+
testGeoGridWithPoints();
133127
}
134128

135129
public static Map<String, Long> getValuesMap(Iterator<Iterator<Object>> values) {

0 commit comments

Comments
 (0)