@@ -138,7 +138,7 @@ public void test_ExceptionAllAccessFieldsNull() {
138
138
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
139
139
verify (actionListener ).onFailure (argumentCaptor .capture ());
140
140
assertEquals (
141
- "User must specify at least one backend role or make the model public/private" ,
141
+ "You must specify at least one backend role or make the model group public/private for registering it. " ,
142
142
argumentCaptor .getValue ().getMessage ()
143
143
);
144
144
}
@@ -160,7 +160,7 @@ public void test_BackendRolesProvidedWithPublic() {
160
160
transportRegisterModelGroupAction .doExecute (task , actionRequest , actionListener );
161
161
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
162
162
verify (actionListener ).onFailure (argumentCaptor .capture ());
163
- assertEquals ("User cannot specify backend roles to a public/private model group" , argumentCaptor .getValue ().getMessage ());
163
+ assertEquals ("You can specify backend roles only for a model group with the restricted access mode. " , argumentCaptor .getValue ().getMessage ());
164
164
}
165
165
166
166
public void test_BackendRolesProvidedWithPrivate () {
@@ -170,7 +170,7 @@ public void test_BackendRolesProvidedWithPrivate() {
170
170
transportRegisterModelGroupAction .doExecute (task , actionRequest , actionListener );
171
171
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
172
172
verify (actionListener ).onFailure (argumentCaptor .capture ());
173
- assertEquals ("User cannot specify backend roles to a public/private model group" , argumentCaptor .getValue ().getMessage ());
173
+ assertEquals ("You can specify backend roles only for a model group with the restricted access mode. " , argumentCaptor .getValue ().getMessage ());
174
174
}
175
175
176
176
public void test_AdminSpecifiedAddAllBackendRolesForRestricted () {
@@ -182,7 +182,7 @@ public void test_AdminSpecifiedAddAllBackendRolesForRestricted() {
182
182
transportRegisterModelGroupAction .doExecute (task , actionRequest , actionListener );
183
183
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
184
184
verify (actionListener ).onFailure (argumentCaptor .capture ());
185
- assertEquals ("Admin user cannot specify add all backend roles to a model group" , argumentCaptor .getValue ().getMessage ());
185
+ assertEquals ("Admin users cannot add all backend roles to a model group. " , argumentCaptor .getValue ().getMessage ());
186
186
}
187
187
188
188
public void test_UserWithNoBackendRolesSpecifiedRestricted () {
@@ -193,7 +193,10 @@ public void test_UserWithNoBackendRolesSpecifiedRestricted() {
193
193
transportRegisterModelGroupAction .doExecute (task , actionRequest , actionListener );
194
194
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
195
195
verify (actionListener ).onFailure (argumentCaptor .capture ());
196
- assertEquals ("Current user has no backend roles to specify the model group as restricted" , argumentCaptor .getValue ().getMessage ());
196
+ assertEquals (
197
+ "You must have at least one backend role to register a restricted model group." ,
198
+ argumentCaptor .getValue ().getMessage ()
199
+ );
197
200
}
198
201
199
202
public void test_UserSpecifiedRestrictedButNoBackendRolesFieldF () {
@@ -205,7 +208,7 @@ public void test_UserSpecifiedRestrictedButNoBackendRolesFieldF() {
205
208
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
206
209
verify (actionListener ).onFailure (argumentCaptor .capture ());
207
210
assertEquals (
208
- "User have to specify backend roles or set add all backend roles to true for a restricted model group" ,
211
+ "You must specify one or more backend roles or add all backend roles to register a restricted model group. " ,
209
212
argumentCaptor .getValue ().getMessage ()
210
213
);
211
214
}
@@ -219,7 +222,7 @@ public void test_RestrictedAndUserSpecifiedBothBackendRolesField() {
219
222
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
220
223
verify (actionListener ).onFailure (argumentCaptor .capture ());
221
224
assertEquals (
222
- "User cannot specify add all backed roles to true and backend roles not empty " ,
225
+ "You cannot specify backend roles and add all backend roles at the same time. " ,
223
226
argumentCaptor .getValue ().getMessage ()
224
227
);
225
228
}
@@ -234,7 +237,7 @@ public void test_RestrictedAndUserSpecifiedIncorrectBackendRoles() {
234
237
transportRegisterModelGroupAction .doExecute (task , actionRequest , actionListener );
235
238
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
236
239
verify (actionListener ).onFailure (argumentCaptor .capture ());
237
- assertEquals ("User cannot specify backend roles that doesn 't belong to the current user " , argumentCaptor .getValue ().getMessage ());
240
+ assertEquals ("You don 't have the backend roles specified. " , argumentCaptor .getValue ().getMessage ());
238
241
}
239
242
240
243
public void test_SuccessSecurityDisabledCluster () {
@@ -254,7 +257,7 @@ public void test_ExceptionSecurityDisabledCluster() {
254
257
ArgumentCaptor <Exception > argumentCaptor = ArgumentCaptor .forClass (Exception .class );
255
258
verify (actionListener ).onFailure (argumentCaptor .capture ());
256
259
assertEquals (
257
- "Cluster security plugin not enabled or model access control no enabled, can't pass access control data in request body " ,
260
+ "You cannot specify model access control parameters because the Security plugin or model access control is disabled on your cluster. " ,
258
261
argumentCaptor .getValue ().getMessage ()
259
262
);
260
263
}
0 commit comments