From ef8de0df6afd1fb2400d6b8b7a11ff46c7479393 Mon Sep 17 00:00:00 2001 From: Ashish Agrawal Date: Tue, 21 Feb 2023 11:24:33 -0800 Subject: [PATCH] fix test issue Signed-off-by: Ashish Agrawal --- .../securityanalytics/SecurityAnalyticsRestTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java b/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java index a4f2df778..3f95c8c42 100644 --- a/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java +++ b/src/test/java/org/opensearch/securityanalytics/SecurityAnalyticsRestTestCase.java @@ -164,7 +164,8 @@ protected String createTestIndex(String index, String mapping, Settings settings protected String createTestIndex(RestClient client, String index, String mapping, Settings settings) throws IOException { Request request = new Request("PUT", "/" + index); - String entity = "{\"settings\": " + Strings.toString(settings); + String entity = "{\"settings\": " + Strings.toString( + settings.toXContent(XContentFactory.jsonBuilder(), ToXContent.EMPTY_PARAMS)); if (mapping != null) { entity = entity + ",\"mappings\" : {" + mapping + "}"; }