Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.9] fix encoding US-ASCII error #1128

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading