|
14 | 14 |
|
15 | 15 | import org.apache.http.util.EntityUtils;
|
16 | 16 | import org.elasticsearch.Build;
|
17 |
| -import org.elasticsearch.Version; |
18 | 17 | import org.elasticsearch.action.admin.cluster.settings.RestClusterGetSettingsResponse;
|
19 | 18 | import org.elasticsearch.client.Request;
|
20 | 19 | import org.elasticsearch.client.Response;
|
@@ -266,10 +265,7 @@ public void testNewReplicas() throws Exception {
|
266 | 265 | }
|
267 | 266 |
|
268 | 267 | public void testSearchTimeSeriesMode() throws Exception {
|
269 |
| - |
270 |
| - var originalClusterHasNewTimeSeriesIndexing = parseLegacyVersion(getOldClusterVersion()).map(v -> v.onOrAfter(Version.V_8_2_0)) |
271 |
| - .orElse(true); |
272 |
| - assumeTrue("indexing time series indices changed in 8.2.0", originalClusterHasNewTimeSeriesIndexing); |
| 268 | + assumeTrue("indexing time series indices changed in 8.2.0", oldClusterHasFeature(RestTestLegacyFeatures.TSDB_NEW_INDEX_FORMAT)); |
273 | 269 | int numDocs;
|
274 | 270 | if (isRunningAgainstOldCluster()) {
|
275 | 271 | numDocs = createTimeSeriesModeIndex(1);
|
@@ -307,9 +303,7 @@ public void testSearchTimeSeriesMode() throws Exception {
|
307 | 303 | }
|
308 | 304 |
|
309 | 305 | public void testNewReplicasTimeSeriesMode() throws Exception {
|
310 |
| - var originalClusterHasNewTimeSeriesIndexing = parseLegacyVersion(getOldClusterVersion()).map(v -> v.onOrAfter(Version.V_8_2_0)) |
311 |
| - .orElse(true); |
312 |
| - assumeTrue("indexing time series indices changed in 8.2.0", originalClusterHasNewTimeSeriesIndexing); |
| 306 | + assumeTrue("indexing time series indices changed in 8.2.0", oldClusterHasFeature(RestTestLegacyFeatures.TSDB_NEW_INDEX_FORMAT)); |
313 | 307 | if (isRunningAgainstOldCluster()) {
|
314 | 308 | createTimeSeriesModeIndex(0);
|
315 | 309 | } else {
|
@@ -1216,9 +1210,7 @@ public void testClosedIndices() throws Exception {
|
1216 | 1210 | }
|
1217 | 1211 |
|
1218 | 1212 | @UpdateForV9 // This check can be removed (always assume true)
|
1219 |
| - var originalClusterSupportsReplicationOfClosedIndices = parseLegacyVersion(getOldClusterVersion()).map( |
1220 |
| - v -> v.onOrAfter(Version.V_7_2_0) |
1221 |
| - ).orElse(true); |
| 1213 | + var originalClusterSupportsReplicationOfClosedIndices = oldClusterHasFeature(RestTestLegacyFeatures.REPLICATION_OF_CLOSED_INDICES); |
1222 | 1214 |
|
1223 | 1215 | if (originalClusterSupportsReplicationOfClosedIndices) {
|
1224 | 1216 | ensureGreenLongWait(index);
|
@@ -1624,9 +1616,7 @@ public void testResize() throws Exception {
|
1624 | 1616 | public void testSystemIndexMetadataIsUpgraded() throws Exception {
|
1625 | 1617 |
|
1626 | 1618 | @UpdateForV9 // assumeTrue can be removed (condition always true)
|
1627 |
| - var originalClusterTaskIndexIsSystemIndex = parseLegacyVersion(getOldClusterVersion()).map(v -> v.onOrAfter(Version.V_7_10_0)) |
1628 |
| - .orElse(true); |
1629 |
| - |
| 1619 | + var originalClusterTaskIndexIsSystemIndex = oldClusterHasFeature(RestTestLegacyFeatures.TASK_INDEX_SYSTEM_INDEX); |
1630 | 1620 | assumeTrue(".tasks became a system index in 7.10.0", originalClusterTaskIndexIsSystemIndex);
|
1631 | 1621 | final String systemIndexWarning = "this request accesses system indices: [.tasks], but in a future major version, direct "
|
1632 | 1622 | + "access to system indices will be prevented by default";
|
@@ -1748,8 +1738,7 @@ public void testSystemIndexMetadataIsUpgraded() throws Exception {
|
1748 | 1738 | */
|
1749 | 1739 | @UpdateForV9 // This test can be removed in v9
|
1750 | 1740 | public void testEnableSoftDeletesOnRestore() throws Exception {
|
1751 |
| - var originalClusterDidNotEnforceSoftDeletes = parseLegacyVersion(getOldClusterVersion()).map(v -> v.before(Version.V_8_0_0)) |
1752 |
| - .orElse(false); |
| 1741 | + var originalClusterDidNotEnforceSoftDeletes = oldClusterHasFeature(RestTestLegacyFeatures.SOFT_DELETES_ENFORCED) == false; |
1753 | 1742 |
|
1754 | 1743 | assumeTrue("soft deletes must be enabled on 8.0+", originalClusterDidNotEnforceSoftDeletes);
|
1755 | 1744 | final String snapshot = "snapshot-" + index;
|
@@ -1862,9 +1851,8 @@ public void testForbidDisableSoftDeletesOnRestore() throws Exception {
|
1862 | 1851 | */
|
1863 | 1852 | @UpdateForV9
|
1864 | 1853 | public void testTransportCompressionSetting() throws IOException {
|
1865 |
| - var originalClusterCompressSettingIsBoolean = parseLegacyVersion(getOldClusterVersion()).map(v -> v.before(Version.V_7_14_0)) |
1866 |
| - .orElse(false); |
1867 |
| - assumeTrue("the old transport.compress setting existed before 7.14", originalClusterCompressSettingIsBoolean); |
| 1854 | + var originalClusterBooleanCompressSetting = oldClusterHasFeature(RestTestLegacyFeatures.NEW_TRANSPORT_COMPRESSED_SETTING) == false; |
| 1855 | + assumeTrue("the old transport.compress setting existed before 7.14", originalClusterBooleanCompressSetting); |
1868 | 1856 | if (isRunningAgainstOldCluster()) {
|
1869 | 1857 | client().performRequest(
|
1870 | 1858 | newXContentRequest(
|
|
0 commit comments