Skip to content

Commit

Permalink
Fix FeatureUpgradeApiIT
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Sep 10, 2024
1 parent 728bd36 commit 59f3ed4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package org.elasticsearch.system.indices;

import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.common.settings.SecureString;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -42,13 +43,17 @@ protected Settings restClientSettings() {
}

public void testCreatingSystemIndex() throws Exception {
Response response = client().performRequest(new Request("PUT", "/_net_new_sys_index/_create"));
var request = new Request("PUT", "/_net_new_sys_index/_create");
request.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("X-elastic-product-origin", "elastic"));
Response response = client().performRequest(request);
assertThat(response.getStatusLine().getStatusCode(), is(200));
}

@SuppressWarnings("unchecked")
public void testGetFeatureUpgradedStatuses() throws Exception {
client().performRequest(new Request("PUT", "/_net_new_sys_index/_create"));
var request = new Request("PUT", "/_net_new_sys_index/_create");
request.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("X-elastic-product-origin", "elastic"));
client().performRequest(request);
Response response = client().performRequest(new Request("GET", "/_migration/system_features"));
assertThat(response.getStatusLine().getStatusCode(), is(200));
XContentTestUtils.JsonMapView view = XContentTestUtils.createJsonMapView(response.getEntity().getContent());
Expand Down

0 comments on commit 59f3ed4

Please sign in to comment.