Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fixing UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
hardik-k-shah committed Nov 19, 2019
1 parent 7f723d1 commit 7a54db0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public void testPutInvalidJson() throws Exception {

rh.keystore = "restapi/kirk-keystore.jks";
rh.sendHTTPClientCertificate = true;
HttpResponse response = rh.executePutRequest("_searchguard/api/roles/dup", "{ \"invalid\"::{{ [\"*\"], \"cluster_permissions\": [\"*\"] }");
HttpResponse response = rh.executePutRequest("_opendistro/_security/api/roles/dup", "{ \"invalid\"::{{ [\"*\"], \"cluster_permissions\": [\"*\"] }");
Assert.assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCode());
Assert.assertTrue(response.getBody().contains("JsonParseException"));
assertHealthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testOpenDistroSecurityRoles() throws Exception {
Settings settings = Settings.builder().loadFromSource(response.getBody(), XContentType.JSON).build();
Assert.assertEquals(35, settings.size());

response = rh.executePatchRequest("/_opendistro/_security/api/internalusers", "[{ \"op\": \"add\", \"path\": \"/newuser\", \"value\": {\"password\": \"newuser\", \"opendistro_security_roles\": [\"opendistro_security_all_access\"] } }]", new Header[0]);
response = rh.executePatchRequest("/_opendistro/_security/api/internalusers", "[{ \"op\": \"add\", \"path\": \"/newuser\", \"value\": {\"password\": \"newuser\", \"opendistro_security_roles\": [\"all_access\"] } }]", new Header[0]);
Assert.assertEquals(response.getBody(), HttpStatus.SC_OK, response.getStatusCode());

response = rh.executeGetRequest("/_opendistro/_security/api/internalusers/newuser", new Header[0]);
Expand Down

0 comments on commit 7a54db0

Please sign in to comment.