|
@@ -15,7 +15,7 @@ import org.elasticsearch.client.RequestOptions;
|
|
|
import org.elasticsearch.client.Response;
|
|
|
import org.elasticsearch.client.ResponseException;
|
|
|
import org.elasticsearch.client.RestClient;
|
|
|
-import org.elasticsearch.cluster.metadata.DataStream;
|
|
|
+import org.elasticsearch.cluster.DataStreamTestHelper;
|
|
|
import org.elasticsearch.common.Strings;
|
|
|
import org.elasticsearch.common.settings.Settings;
|
|
|
import org.elasticsearch.common.util.concurrent.ThreadContext;
|
|
@@ -695,17 +695,15 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|
|
}
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
- @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/70833")
|
|
|
public void testDataStreams() throws Exception {
|
|
|
assumeTrue("no data streams in versions before " + Version.V_7_9_0, getOldClusterVersion().onOrAfter(Version.V_7_9_0));
|
|
|
if (isRunningAgainstOldCluster()) {
|
|
|
createComposableTemplate(client(), "dst", "ds");
|
|
|
|
|
|
Request indexRequest = new Request("POST", "/ds/_doc/1?op_type=create&refresh");
|
|
|
- XContentBuilder builder = JsonXContent.contentBuilder().startObject()
|
|
|
- .field("f", "v")
|
|
|
- .field("@timestamp", System.currentTimeMillis())
|
|
|
- .endObject();
|
|
|
+ XContentBuilder
|
|
|
+ builder =
|
|
|
+ JsonXContent.contentBuilder().startObject().field("f", "v").field("@timestamp", System.currentTimeMillis()).endObject();
|
|
|
indexRequest.setJsonEntity(Strings.toString(builder));
|
|
|
assertOK(client().performRequest(indexRequest));
|
|
|
}
|
|
@@ -732,7 +730,8 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase {
|
|
|
List<Map<String, String>> indices = (List<Map<String, String>>) ds.get("indices");
|
|
|
assertEquals("ds", ds.get("name"));
|
|
|
assertEquals(1, indices.size());
|
|
|
- assertEquals(DataStream.getDefaultBackingIndexName("ds", 1, timestamp), indices.get(0).get("index_name"));
|
|
|
+ assertEquals(DataStreamTestHelper.getLegacyDefaultBackingIndexName("ds", 1, timestamp, getOldClusterVersion()),
|
|
|
+ indices.get(0).get("index_name"));
|
|
|
assertNumHits("ds", 1, 1);
|
|
|
}
|
|
|
|