@@ -32,9 +32,9 @@ public void testPutManyValidRoles() throws Exception {
3232 "test1" ,
3333 new RoleDescriptor (
3434 "test1" ,
35- new String []{ "all" },
36- new RoleDescriptor .IndicesPrivileges []{
37- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build ()},
35+ new String [] { "all" },
36+ new RoleDescriptor .IndicesPrivileges [] {
37+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build () },
3838 null ,
3939 null ,
4040 null ,
@@ -50,9 +50,9 @@ public void testPutManyValidRoles() throws Exception {
5050 "test2" ,
5151 new RoleDescriptor (
5252 "test2" ,
53- new String []{ "all" },
54- new RoleDescriptor .IndicesPrivileges []{
55- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("read" ).build ()},
53+ new String [] { "all" },
54+ new RoleDescriptor .IndicesPrivileges [] {
55+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("read" ).build () },
5656 null ,
5757 null ,
5858 null ,
@@ -68,9 +68,9 @@ public void testPutManyValidRoles() throws Exception {
6868 "test3" ,
6969 new RoleDescriptor (
7070 "test3" ,
71- new String []{ "all" },
72- new RoleDescriptor .IndicesPrivileges []{
73- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build ()},
71+ new String [] { "all" },
72+ new RoleDescriptor .IndicesPrivileges [] {
73+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build () },
7474 null ,
7575 null ,
7676 null ,
@@ -110,9 +110,9 @@ public void testPutMixedValidInvalidRoles() throws Exception {
110110 "test1" ,
111111 new RoleDescriptor (
112112 "test1" ,
113- new String []{ "all" },
114- new RoleDescriptor .IndicesPrivileges []{
115- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build ()},
113+ new String [] { "all" },
114+ new RoleDescriptor .IndicesPrivileges [] {
115+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build () },
116116 null ,
117117 null ,
118118 null ,
@@ -129,9 +129,9 @@ public void testPutMixedValidInvalidRoles() throws Exception {
129129 "test3" ,
130130 new RoleDescriptor (
131131 "test3" ,
132- new String []{ "all" },
133- new RoleDescriptor .IndicesPrivileges []{
134- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build ()},
132+ new String [] { "all" },
133+ new RoleDescriptor .IndicesPrivileges [] {
134+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build () },
135135 null ,
136136 null ,
137137 null ,
@@ -195,9 +195,9 @@ public void testBulkUpdates() throws Exception {
195195 "test1" ,
196196 new RoleDescriptor (
197197 "test1" ,
198- new String []{ "all" },
199- new RoleDescriptor .IndicesPrivileges []{
200- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build ()},
198+ new String [] { "all" },
199+ new RoleDescriptor .IndicesPrivileges [] {
200+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build () },
201201 null ,
202202 null ,
203203 null ,
@@ -213,9 +213,9 @@ public void testBulkUpdates() throws Exception {
213213 "test2" ,
214214 new RoleDescriptor (
215215 "test2" ,
216- new String []{ "all" },
217- new RoleDescriptor .IndicesPrivileges []{
218- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("read" ).build ()},
216+ new String [] { "all" },
217+ new RoleDescriptor .IndicesPrivileges [] {
218+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("read" ).build () },
219219 null ,
220220 null ,
221221 null ,
@@ -231,19 +231,19 @@ public void testBulkUpdates() throws Exception {
231231 "test3" ,
232232 new RoleDescriptor (
233233 "test3" ,
234- new String []{ "all" },
235- new RoleDescriptor .IndicesPrivileges []{
236- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build ()},
234+ new String [] { "all" },
235+ new RoleDescriptor .IndicesPrivileges [] {
236+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("write" ).build () },
237237 null ,
238238 null ,
239239 null ,
240240 null ,
241241 null ,
242- new RoleDescriptor .RemoteIndicesPrivileges []{
242+ new RoleDescriptor .RemoteIndicesPrivileges [] {
243243 RoleDescriptor .RemoteIndicesPrivileges .builder ("my_cluster*" , "other_cluster" )
244244 .indices ("logs-*" )
245245 .privileges ("read" )
246- .build ()},
246+ .build () },
247247 null ,
248248 null ,
249249 null
@@ -278,9 +278,9 @@ public void testBulkUpdates() throws Exception {
278278 "test2" ,
279279 new RoleDescriptor (
280280 "test2" ,
281- new String []{ "all" },
282- new RoleDescriptor .IndicesPrivileges []{
283- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build ()},
281+ new String [] { "all" },
282+ new RoleDescriptor .IndicesPrivileges [] {
283+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build () },
284284 null ,
285285 null ,
286286 null ,
@@ -296,9 +296,9 @@ public void testBulkUpdates() throws Exception {
296296 "test3" ,
297297 new RoleDescriptor (
298298 "test3" ,
299- new String []{ "all" },
300- new RoleDescriptor .IndicesPrivileges []{
301- RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build ()},
299+ new String [] { "all" },
300+ new RoleDescriptor .IndicesPrivileges [] {
301+ RoleDescriptor .IndicesPrivileges .builder ().indices ("*" ).privileges ("all" ).build () },
302302 null ,
303303 null ,
304304 null ,
@@ -316,9 +316,7 @@ public void testBulkUpdates() throws Exception {
316316 public void testPutRoleWithInvalidManageRolesPrivilege () throws Exception {
317317 final String badRoleName = "bad-role" ;
318318
319- final ResponseException exception = expectThrows (
320- ResponseException .class ,
321- () -> upsertRoles (String .format ("""
319+ final ResponseException exception = expectThrows (ResponseException .class , () -> upsertRoles (String .format ("""
322320 {
323321 "roles": {
324322 "%s": {
@@ -336,8 +334,7 @@ public void testPutRoleWithInvalidManageRolesPrivilege() throws Exception {
336334 }
337335 }
338336 }
339- }""" , badRoleName ))
340- );
337+ }""" , badRoleName )));
341338
342339 assertThat (exception .getMessage (), containsString ("unknown index privilege [foobar]" ));
343340 assertRoleDoesNotExist (badRoleName );
@@ -351,4 +348,3 @@ private void assertRoleDoesNotExist(final String roleName) throws Exception {
351348 assertEquals (404 , roleNotFound .getResponse ().getStatusLine ().getStatusCode ());
352349 }
353350}
354-
0 commit comments