From 979ac6864a757d3d33200eb9c5f9bf76f81dd967 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 17:14:24 -0700 Subject: [PATCH] =?UTF-8?q?Changing=20messaging=20for=20ILlegalArgumentExc?= =?UTF-8?q?eption=20on=20duplicate=20model=20gr=E2=80=A6=20(#1294)=20(#129?= =?UTF-8?q?9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Changing messaging for ILlegalArgumentException on duplicate model group creation. Signed-off-by: Nate Boot * Adjusting the test. `./gradlew test` passes. Signed-off-by: Nate Boot --------- Signed-off-by: Nate Boot (cherry picked from commit a9687fc3958a0a5fe39bbf493cc2f287fe101e97) Co-authored-by: Nate B <96254688+nateynateynate@users.noreply.github.com> --- .../java/org/opensearch/ml/model/MLModelGroupManager.java | 6 +----- .../org/opensearch/ml/model/MLModelGroupManagerTests.java | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java index 52e9e6d2b7..efc78edf20 100644 --- a/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java +++ b/plugin/src/main/java/org/opensearch/ml/model/MLModelGroupManager.java @@ -75,11 +75,7 @@ public void createModelGroup(MLRegisterModelGroupInput input, ActionListener argumentCaptor = ArgumentCaptor.forClass(Exception.class); verify(actionListener).onFailure(argumentCaptor.capture()); assertEquals( - "The name you provided is already being used by another model with ID: model_group_ID. Please provide a different name or add \"model_group_id\": \"model_group_ID\" to request body", + "The name you provided is already being used by a model group with ID: model_group_ID.", argumentCaptor.getValue().getMessage() );