Skip to content

Commit

Permalink
fix encoding US-ASCII error (#1126) (#1128)
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavana Ramaram <[email protected]>
(cherry picked from commit 5e4d60b)

Co-authored-by: Bhavana Ramaram <[email protected]>
  • Loading branch information
opensearch-trigger-bot[bot] and rbhavna authored Jul 14, 2023
1 parent c6bc750 commit 21dc457
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private void validateRequestForAccessControl(MLUpdateModelGroupInput input, User
&& !modelAccessControlHelper.isAdmin(user)
&& !modelAccessControlHelper.isOwnerStillHasPermission(user, mlModelGroup)) {
throw new IllegalArgumentException(
"You dont have the specified backend role to update this model group. For more information, contact your administrator."
"You don't have the specified backend role to update this model group. For more information, contact your administrator."
);
}
AccessMode accessMode = input.getModelAccessMode();
Expand All @@ -230,7 +230,7 @@ private void validateRequestForAccessControl(MLUpdateModelGroupInput input, User
throw new IllegalArgumentException("Admin users cannot add all backend roles to a model group.");
}
if (Boolean.TRUE.equals(input.getIsAddAllBackendRoles()) && CollectionUtils.isEmpty(user.getBackendRoles())) {
throw new IllegalArgumentException("You dont have any backend roles.");
throw new IllegalArgumentException("You don't have any backend roles.");
}
if (CollectionUtils.isEmpty(input.getBackendRoles()) && Boolean.FALSE.equals(input.getIsAddAllBackendRoles())) {
throw new IllegalArgumentException("You have to specify backend roles when add all backend roles is set to false.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void test_OwnerNoMoreHasPermissionException() {
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
verify(actionListener).onFailure(argumentCaptor.capture());
assertEquals(
"You dont have the specified backend role to update this model group. For more information, contact your administrator.",
"You don't have the specified backend role to update this model group. For more information, contact your administrator.",
argumentCaptor.getValue().getMessage()
);
}
Expand Down Expand Up @@ -236,7 +236,7 @@ public void test_UserWithNoBackendRolesSpecifiedRestricted() {
transportUpdateModelGroupAction.doExecute(task, actionRequest, actionListener);
ArgumentCaptor<Exception> argumentCaptor = ArgumentCaptor.forClass(Exception.class);
verify(actionListener).onFailure(argumentCaptor.capture());
assertEquals("You dont have any backend roles.", argumentCaptor.getValue().getMessage());
assertEquals("You don't have any backend roles.", argumentCaptor.getValue().getMessage());
}

public void test_UserSpecifiedRestrictedButNoBackendRolesField() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ public void test_RegisterModelGroupForUser4WithPublic() throws IOException {
updateModelGroup(user4Client, modelGroupId, TestHelper.toJsonString(mlUpdateModelGroupInput), null);
} catch (Exception e) {
assertEquals(ResponseException.class, e.getClass());
assertTrue(Throwables.getStackTraceAsString(e).contains("You dont have any backend roles."));
assertTrue(Throwables.getStackTraceAsString(e).contains("You don't have any backend roles."));
}
try {
mlUpdateModelGroupInput = createUpdateModelGroupInput(
Expand Down Expand Up @@ -1020,7 +1020,7 @@ public void test_RegisterModelGroupForUser4WithPrivate() throws IOException {
updateModelGroup(user4Client, modelGroupId, TestHelper.toJsonString(mlUpdateModelGroupInput), null);
} catch (Exception e) {
assertEquals(ResponseException.class, e.getClass());
assertTrue(Throwables.getStackTraceAsString(e).contains("You dont have any backend roles."));
assertTrue(Throwables.getStackTraceAsString(e).contains("You don't have any backend roles."));
}
try {
mlUpdateModelGroupInput = createUpdateModelGroupInput(modelGroupId, "name", "description", null, null, null);
Expand Down

0 comments on commit 21dc457

Please sign in to comment.