Skip to content

Commit

Permalink
Fix NetNewSystemIndicesIT
Browse files Browse the repository at this point in the history
  • Loading branch information
dakrone committed Sep 10, 2024
1 parent aab6a56 commit 728bd36
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import org.apache.http.util.EntityUtils;
import org.elasticsearch.client.Request;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.settings.SecureString;
Expand Down Expand Up @@ -39,7 +40,9 @@ public void testCreatingSystemIndex() throws Exception {
);
assertThat(EntityUtils.toString(e.getResponse().getEntity()), containsString("system"));

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));
}

Expand All @@ -55,6 +58,7 @@ public void testIndexDoc() throws Exception {

Request request = new Request("PUT", "/_net_new_sys_index/" + id);
request.setJsonEntity("{}");
request.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("X-elastic-product-origin", "elastic"));
Response response = client().performRequest(request);
assertThat(response.getStatusLine().getStatusCode(), is(200));
}
Expand All @@ -73,6 +77,7 @@ public void testSearch() throws Exception {
Request request = new Request("PUT", "/_net_new_sys_index/" + id);
request.setJsonEntity("{}");
request.addParameter("refresh", "true");
request.setOptions(RequestOptions.DEFAULT.toBuilder().addHeader("X-elastic-product-origin", "elastic"));
Response response = client().performRequest(request);
assertThat(response.getStatusLine().getStatusCode(), is(200));

Expand Down

0 comments on commit 728bd36

Please sign in to comment.