File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
plugin/src/test/java/org/opensearch/ml/rest Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1010import java .util .Arrays ;
1111import java .util .Map ;
1212
13+ import org .apache .http .HttpHeaders ;
1314import org .apache .http .HttpHost ;
15+ import org .apache .http .message .BasicHeader ;
1416import org .junit .After ;
1517import org .junit .Before ;
1618import org .junit .Rule ;
1719import org .junit .rules .ExpectedException ;
20+ import org .opensearch .client .Response ;
1821import org .opensearch .client .ResponseException ;
1922import org .opensearch .client .RestClient ;
2023import org .opensearch .commons .rest .SecureRestClientBuilder ;
2932import org .opensearch .search .builder .SearchSourceBuilder ;
3033
3134import com .google .common .base .Throwables ;
35+ import com .google .common .collect .ImmutableList ;
3236
3337public class SecureMLRestIT extends MLCommonsRestTestCase {
3438 private String irisIndex = "iris_data_secure_ml_it" ;
@@ -56,6 +60,17 @@ public class SecureMLRestIT extends MLCommonsRestTestCase {
5660
5761 @ Before
5862 public void setup () throws IOException {
63+ Response response = TestHelper
64+ .makeRequest (
65+ client (),
66+ "PUT" ,
67+ "_cluster/settings" ,
68+ null ,
69+ "{\" persistent\" :{\" plugins.ml_commons.model_access_control_enabled\" :true}}" ,
70+ ImmutableList .of (new BasicHeader (HttpHeaders .USER_AGENT , "" ))
71+ );
72+ assertEquals (200 , response .getStatusLine ().getStatusCode ());
73+
5974 if (!isHttps ()) {
6075 throw new IllegalArgumentException ("Secure Tests are running but HTTPS is not set" );
6176 }
You can’t perform that action at this time.
0 commit comments