Skip to content

Commit

Permalink
Merge branch '2.x' into remove_ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbogan committed Jul 14, 2023
2 parents 64d9f7e + f672aa8 commit a564dc2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 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
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ private void disableClusterConnectorAccessControl() throws IOException {
"PUT",
"_cluster/settings",
null,
"{\"persistent\":{\"plugins.ml_commons.connector_access_control_enabled\":false}}",
"{\"persistent\":{\"plugins.ml_commons.connector_access_control_enabled\":false, \"plugins.ml_commons.sync_up_job_interval_in_seconds\":3}}",
ImmutableList.of(new BasicHeader(HttpHeaders.USER_AGENT, ""))
);
assertEquals(200, response.getStatusLine().getStatusCode());
Expand Down

0 comments on commit a564dc2

Please sign in to comment.