From 730f21cba2e2fa6d481d8ea5973bf62fa0e010f8 Mon Sep 17 00:00:00 2001 From: Sarat Vemulapalli Date: Mon, 7 Aug 2023 16:16:03 -0700 Subject: [PATCH] [Main] Fixing breaking changes from core in 3.0 (#1191) * Fixing breaking changes to main Signed-off-by: Sarat Vemulapalli * Removing extra lines Signed-off-by: Sarat Vemulapalli --------- Signed-off-by: Sarat Vemulapalli --- .../src/test/java/org/opensearch/ml/common/TestHelper.java | 2 +- .../org/opensearch/ml/common/dataframe/BooleanValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/ColumnMetaTest.java | 5 +---- .../opensearch/ml/common/dataframe/DefaultDataFrameTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/DoubleValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/FloatValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/IntValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/LongValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/NullValueTest.java | 3 +-- .../java/org/opensearch/ml/common/dataframe/RowTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/ShortValueTest.java | 3 +-- .../org/opensearch/ml/common/dataframe/StringValueTest.java | 3 +-- .../java/org/opensearch/ml/common/input/MLInputTest.java | 2 +- .../anomalylocalization/AnomalyLocalizationInputTests.java | 4 ++-- .../opensearch/ml/common/input/nlp/TextDocsMLInputTest.java | 2 +- .../opensearch/ml/common/output/MLPredictionOutputTest.java | 4 ++-- .../opensearch/ml/common/output/MLTrainingOutputTest.java | 4 +--- .../anomalylocalization/AnomalyLocalizationOutputTests.java | 3 +-- .../samplecalculator/LocalSampleCalculatorOutputTest.java | 4 ++-- .../ml/common/output/sample/SampleAlgoOutputTest.java | 4 ++-- .../transport/deploy/MLDeployModelNodesResponseTest.java | 2 +- .../common/transport/deploy/MLDeployModelResponseTest.java | 2 +- .../common/transport/execute/MLExecuteTaskResponseTest.java | 3 +-- .../ml/common/transport/forward/MLForwardResponseTest.java | 2 +- .../ml/common/transport/model/MLModelGetResponseTest.java | 2 +- .../transport/prediction/MLPredictionTaskResponseTest.java | 2 +- .../common/transport/register/MLRegisterModelInputTest.java | 5 ++--- .../transport/register/MLRegisterModelResponseTest.java | 2 +- .../ml/common/transport/sync/MLSyncUpResponseTest.java | 2 +- .../ml/common/transport/task/MLTaskGetResponseTest.java | 4 +--- .../common/transport/undeploy/MLUndeployModelInputTest.java | 3 +-- .../transport/undeploy/MLUndeployModelNodesResponseTest.java | 2 +- .../transport/upload_chunk/MLUploadModelChunkInputTest.java | 3 +-- .../main/java/org/opensearch/ml/utils/MLExceptionUtils.java | 3 +-- .../test/java/org/opensearch/ml/utils/IntegTestUtils.java | 2 +- 35 files changed, 40 insertions(+), 63 deletions(-) diff --git a/common/src/test/java/org/opensearch/ml/common/TestHelper.java b/common/src/test/java/org/opensearch/ml/common/TestHelper.java index e1c5c9d03d..baa40f9102 100644 --- a/common/src/test/java/org/opensearch/ml/common/TestHelper.java +++ b/common/src/test/java/org/opensearch/ml/common/TestHelper.java @@ -36,7 +36,7 @@ public static void testParse(ToXContentObject obj, Function nodeErrors) throws IOExcep builder.field(entry.getKey(), entry.getValue()); } builder.endObject(); - return Strings.toString(builder); + return builder.toString(); } public static void logException(String errorMessage, Exception e, Logger log) { diff --git a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java index c97994c5be..511cad9655 100644 --- a/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java +++ b/plugin/src/test/java/org/opensearch/ml/utils/IntegTestUtils.java @@ -196,7 +196,7 @@ public static void predictAndVerifyResult(String taskId, MLInputDataset inputDat MLPredictionOutput mlPredictionOutput = (MLPredictionOutput) predictionResponse.getOutput(); mlPredictionOutput.getPredictionResult().toXContent(builder, ToXContent.EMPTY_PARAMS); builder.endObject(); - String jsonStr = org.opensearch.common.Strings.toString(builder); + String jsonStr = builder.toString(); String expectedStr1 = "{\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}]," + "\"rows\":[{\"values\":[{\"column_type\":\"INTEGER\",\"value\":0}]}]}"; String expectedStr2 = "{\"column_metas\":[{\"name\":\"ClusterID\",\"column_type\":\"INTEGER\"}],"