@@ -58,6 +58,7 @@ public class MLModelGroupRestIT extends MLCommonsRestTestCase {
58
58
public ExpectedException exceptionRule = ExpectedException .none ();
59
59
60
60
private String modelGroupId ;
61
+ private String password = "IntegTest@MLModelGroupRestIT123" ;
61
62
62
63
@ Before
63
64
public void setup () throws IOException {
@@ -77,56 +78,43 @@ public void setup() throws IOException {
77
78
}
78
79
createSearchRole (indexSearchAccessRole , "*" );
79
80
80
- createUser (mlNoAccessUser , mlNoAccessUser , ImmutableList .of (opensearchBackendRole ));
81
- mlNoAccessClient = new SecureRestClientBuilder (
82
- getClusterHosts ().toArray (new HttpHost [0 ]),
83
- isHttps (),
84
- mlNoAccessUser ,
85
- mlNoAccessUser
86
- ).setSocketTimeout (60000 ).build ();
81
+ createUser (mlNoAccessUser , password , ImmutableList .of (opensearchBackendRole ));
82
+ mlNoAccessClient = new SecureRestClientBuilder (getClusterHosts ().toArray (new HttpHost [0 ]), isHttps (), mlNoAccessUser , password )
83
+ .setSocketTimeout (60000 )
84
+ .build ();
87
85
88
- createUser (mlReadOnlyUser , mlReadOnlyUser , ImmutableList .of (opensearchBackendRole ));
89
- mlReadOnlyClient = new SecureRestClientBuilder (
90
- getClusterHosts ().toArray (new HttpHost [0 ]),
91
- isHttps (),
92
- mlReadOnlyUser ,
93
- mlReadOnlyUser
94
- ).setSocketTimeout (60000 ).build ();
86
+ createUser (mlReadOnlyUser , password , ImmutableList .of (opensearchBackendRole ));
87
+ mlReadOnlyClient = new SecureRestClientBuilder (getClusterHosts ().toArray (new HttpHost [0 ]), isHttps (), mlReadOnlyUser , password )
88
+ .setSocketTimeout (60000 )
89
+ .build ();
95
90
96
- createUser (mlFullAccessNoIndexAccessUser , mlFullAccessNoIndexAccessUser , ImmutableList .of (opensearchBackendRole ));
91
+ createUser (mlFullAccessNoIndexAccessUser , password , ImmutableList .of (opensearchBackendRole ));
97
92
mlFullAccessNoIndexAccessClient = new SecureRestClientBuilder (
98
93
getClusterHosts ().toArray (new HttpHost [0 ]),
99
94
isHttps (),
100
95
mlFullAccessNoIndexAccessUser ,
101
- mlFullAccessNoIndexAccessUser
96
+ password
102
97
).setSocketTimeout (60000 ).build ();
103
98
104
- createUser (mlFullAccessUser , mlFullAccessUser , ImmutableList .of (opensearchBackendRole ));
105
- mlFullAccessClient = new SecureRestClientBuilder (
106
- getClusterHosts ().toArray (new HttpHost [0 ]),
107
- isHttps (),
108
- mlFullAccessUser ,
109
- mlFullAccessUser
110
- ).setSocketTimeout (60000 ).build ();
99
+ createUser (mlFullAccessUser , password , ImmutableList .of (opensearchBackendRole ));
100
+ mlFullAccessClient = new SecureRestClientBuilder (getClusterHosts ().toArray (new HttpHost [0 ]), isHttps (), mlFullAccessUser , password )
101
+ .setSocketTimeout (60000 )
102
+ .build ();
111
103
112
- createUser (mlNonAdminFullAccessWithoutBackendRoleUser , mlNonAdminFullAccessWithoutBackendRoleUser , ImmutableList .of ());
104
+ createUser (mlNonAdminFullAccessWithoutBackendRoleUser , password , ImmutableList .of ());
113
105
mlNonAdminFullAccessWithoutBackendRoleClient = new SecureRestClientBuilder (
114
106
getClusterHosts ().toArray (new HttpHost [0 ]),
115
107
isHttps (),
116
108
mlNonAdminFullAccessWithoutBackendRoleUser ,
117
- mlNonAdminFullAccessWithoutBackendRoleUser
109
+ password
118
110
).setSocketTimeout (60000 ).build ();
119
111
120
- createUser (
121
- mlNonOwnerFullAccessWithBackendRoleUser ,
122
- mlNonOwnerFullAccessWithBackendRoleUser ,
123
- ImmutableList .of (opensearchBackendRole )
124
- );
112
+ createUser (mlNonOwnerFullAccessWithBackendRoleUser , password , ImmutableList .of (opensearchBackendRole ));
125
113
mlNonOwnerFullAccessWithBackendRoleClient = new SecureRestClientBuilder (
126
114
getClusterHosts ().toArray (new HttpHost [0 ]),
127
115
isHttps (),
128
116
mlNonOwnerFullAccessWithBackendRoleUser ,
129
- mlNonOwnerFullAccessWithBackendRoleUser
117
+ password
130
118
).setSocketTimeout (60000 ).build ();
131
119
132
120
createRoleMapping ("ml_read_access" , ImmutableList .of (mlReadOnlyUser ));
0 commit comments