Skip to content

Commit

Permalink
Adjusting code so tests can pass
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Gaievski <[email protected]>
  • Loading branch information
martin-gaievski committed Oct 11, 2023
1 parent 805a2ad commit 2518f57
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -752,20 +752,20 @@ protected String getDeployedModelId() {
@SneakyThrows
private String registerModelGroup() {
String modelGroupRegisterRequestBody = Files.readString(
Path.of(classLoader.getResource("processor/CreateModelGroupRequestBody.json").toURI())
Path.of(classLoader.getResource("processor/CreateModelGroupRequestBody.json").toURI())
).replace("<MODEL_GROUP_NAME>", "public_model_" + RandomizedTest.randomAsciiAlphanumOfLength(8));
Response modelGroupResponse = makeRequest(
client(),
"POST",
"/_plugins/_ml/model_groups/_register",
null,
toHttpEntity(modelGroupRegisterRequestBody),
ImmutableList.of(new BasicHeader(HttpHeaders.USER_AGENT, "Kibana"))
client(),
"POST",
"/_plugins/_ml/model_groups/_register",
null,
toHttpEntity(modelGroupRegisterRequestBody),
ImmutableList.of(new BasicHeader(HttpHeaders.USER_AGENT, "Kibana"))
);
Map<String, Object> modelGroupResJson = XContentHelper.convertToMap(
XContentType.JSON.xContent(),
EntityUtils.toString(modelGroupResponse.getEntity()),
false
XContentType.JSON.xContent(),
EntityUtils.toString(modelGroupResponse.getEntity()),
false
);
String modelGroupId = modelGroupResJson.get("model_group_id").toString();
assertNotNull(modelGroupId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

import lombok.SneakyThrows;

import org.apache.http.HttpHeaders;
import org.apache.http.message.BasicHeader;
import org.apache.http.util.EntityUtils;

import org.apache.hc.core5.http.HttpHeaders;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.message.BasicHeader;
import org.junit.After;
import org.opensearch.client.Response;
import org.opensearch.common.xcontent.XContentHelper;
Expand Down

0 comments on commit 2518f57

Please sign in to comment.