Skip to content

Commit 21dc457

Browse files
fix encoding US-ASCII error (#1126) (#1128)
Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit 5e4d60b) Co-authored-by: Bhavana Ramaram <[email protected]>
1 parent c6bc750 commit 21dc457

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

plugin/src/main/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ private void validateRequestForAccessControl(MLUpdateModelGroupInput input, User
218218
&& !modelAccessControlHelper.isAdmin(user)
219219
&& !modelAccessControlHelper.isOwnerStillHasPermission(user, mlModelGroup)) {
220220
throw new IllegalArgumentException(
221-
"You dont have the specified backend role to update this model group. For more information, contact your administrator."
221+
"You don't have the specified backend role to update this model group. For more information, contact your administrator."
222222
);
223223
}
224224
AccessMode accessMode = input.getModelAccessMode();
@@ -230,7 +230,7 @@ private void validateRequestForAccessControl(MLUpdateModelGroupInput input, User
230230
throw new IllegalArgumentException("Admin users cannot add all backend roles to a model group.");
231231
}
232232
if (Boolean.TRUE.equals(input.getIsAddAllBackendRoles()) && CollectionUtils.isEmpty(user.getBackendRoles())) {
233-
throw new IllegalArgumentException("You dont have any backend roles.");
233+
throw new IllegalArgumentException("You don't have any backend roles.");
234234
}
235235
if (CollectionUtils.isEmpty(input.getBackendRoles()) && Boolean.FALSE.equals(input.getIsAddAllBackendRoles())) {
236236
throw new IllegalArgumentException("You have to specify backend roles when add all backend roles is set to false.");

plugin/src/test/java/org/opensearch/ml/action/model_group/TransportUpdateModelGroupActionTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public void test_OwnerNoMoreHasPermissionException() {
172172
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
173173
verify(actionListener).onFailure(argumentCaptor.capture());
174174
assertEquals(
175-
"You dont have the specified backend role to update this model group. For more information, contact your administrator.",
175+
"You don't have the specified backend role to update this model group. For more information, contact your administrator.",
176176
argumentCaptor.getValue().getMessage()
177177
);
178178
}
@@ -236,7 +236,7 @@ public void test_UserWithNoBackendRolesSpecifiedRestricted() {
236236
transportUpdateModelGroupAction.doExecute(task, actionRequest, actionListener);
237237
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
238238
verify(actionListener).onFailure(argumentCaptor.capture());
239-
assertEquals("You dont have any backend roles.", argumentCaptor.getValue().getMessage());
239+
assertEquals("You don't have any backend roles.", argumentCaptor.getValue().getMessage());
240240
}
241241

242242
public void test_UserSpecifiedRestrictedButNoBackendRolesField() {

plugin/src/test/java/org/opensearch/ml/rest/MLModelGroupRestIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ public void test_RegisterModelGroupForUser4WithPublic() throws IOException {
954954
updateModelGroup(user4Client, modelGroupId, TestHelper.toJsonString(mlUpdateModelGroupInput), null);
955955
} catch (Exception e) {
956956
assertEquals(ResponseException.class, e.getClass());
957-
assertTrue(Throwables.getStackTraceAsString(e).contains("You dont have any backend roles."));
957+
assertTrue(Throwables.getStackTraceAsString(e).contains("You don't have any backend roles."));
958958
}
959959
try {
960960
mlUpdateModelGroupInput = createUpdateModelGroupInput(
@@ -1020,7 +1020,7 @@ public void test_RegisterModelGroupForUser4WithPrivate() throws IOException {
10201020
updateModelGroup(user4Client, modelGroupId, TestHelper.toJsonString(mlUpdateModelGroupInput), null);
10211021
} catch (Exception e) {
10221022
assertEquals(ResponseException.class, e.getClass());
1023-
assertTrue(Throwables.getStackTraceAsString(e).contains("You dont have any backend roles."));
1023+
assertTrue(Throwables.getStackTraceAsString(e).contains("You don't have any backend roles."));
10241024
}
10251025
try {
10261026
mlUpdateModelGroupInput = createUpdateModelGroupInput(modelGroupId, "name", "description", null, null, null);

0 commit comments

Comments
 (0)