@Test public void updateEntityByName() throws Exception { String token = "4EpPYDSfgN2D4Gf7UmNO3nuL"; String name = "name"; OIDCEntityRequest oidcEntityRequest = new OIDCEntityRequest(); oidcEntityRequest.setDisabled(false); Map<String, String> metadata = new HashMap<String, String>(); metadata.put("organization", "t-vault"); oidcEntityRequest.setMetadata(metadata); oidcEntityRequest.setPolicies(null); oidcEntityRequest.setName(name); Response response = getMockResponse(HttpStatus.OK, true, "{\"data\": [\"safeadmin\",\"vaultadmin\"]]"); when(OIDCUtil.updateEntityByName(token, oidcEntityRequest)).thenReturn(response); ResponseEntity<String> responseEntity = oidcAuthService.updateEntityByName(token, oidcEntityRequest); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); }
public ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "Update Entity By Name") .put(LogMessage.MESSAGE, "Trying to update entity by name") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); Response response = oidcUtil.updateEntityByName(token, oidcEntityRequest); return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }
OIDCAuthService { public ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "Update Entity By Name") .put(LogMessage.MESSAGE, "Trying to update entity by name") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); Response response = oidcUtil.updateEntityByName(token, oidcEntityRequest); return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); } }
OIDCAuthService { public ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "Update Entity By Name") .put(LogMessage.MESSAGE, "Trying to update entity by name") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); Response response = oidcUtil.updateEntityByName(token, oidcEntityRequest); return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }  }
OIDCAuthService { public ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "Update Entity By Name") .put(LogMessage.MESSAGE, "Trying to update entity by name") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); Response response = oidcUtil.updateEntityByName(token, oidcEntityRequest); return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }  ResponseEntity<String> getAuthenticationMounts(String token); ResponseEntity<OIDCEntityResponse> entityLookUp(String token,
			OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> groupEntityLookUp(String token, OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> readEntityAliasById(String token, String id); ResponseEntity<String> readEntityByName(String token, String entityName); ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest); ResponseEntity<String> updateIdentityGroupByName(String token,
                                                            OIDCIdentityGroupRequest oidcIdentityGroupRequest); ResponseEntity<String> readGroupAliasById(String token, String id); ResponseEntity<String> deleteGroupByName(String token, String name); ResponseEntity<String> deleteGroupAliasByID(String token, String id); ResponseEntity<String> createGroupAlias(String token, GroupAliasRequest groupAliasRequest); ResponseEntity<String> getAuthUrl(OidcRequest oidcRequest); ResponseEntity<String> processOIDCCallback(String state, String code); ResponseEntity<String> getGroupObjectIdFromAzure(String groupName); ResponseEntity<String> getIdentityGroupDetails(String groupName, String token); ResponseEntity<String> getUserName(UserDetails userDetails); ResponseEntity<DirectoryObjects> searchGroupInAzureAD(String groupName); }
OIDCAuthService { public ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest) { log.debug(JSONUtil.getJSON(ImmutableMap.<String, String>builder() .put(LogMessage.USER, ThreadLocalContext.getCurrentMap().get(LogMessage.USER)) .put(LogMessage.ACTION, "Update Entity By Name") .put(LogMessage.MESSAGE, "Trying to update entity by name") .put(LogMessage.APIURL, ThreadLocalContext.getCurrentMap().get(LogMessage.APIURL)).build())); Response response = oidcUtil.updateEntityByName(token, oidcEntityRequest); return ResponseEntity.status(response.getHttpstatus()).body(response.getResponse()); }  ResponseEntity<String> getAuthenticationMounts(String token); ResponseEntity<OIDCEntityResponse> entityLookUp(String token,
			OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> groupEntityLookUp(String token, OIDCLookupEntityRequest oidcLookupEntityRequest); ResponseEntity<String> readEntityAliasById(String token, String id); ResponseEntity<String> readEntityByName(String token, String entityName); ResponseEntity<String> updateEntityByName(String token, OIDCEntityRequest oidcEntityRequest); ResponseEntity<String> updateIdentityGroupByName(String token,
                                                            OIDCIdentityGroupRequest oidcIdentityGroupRequest); ResponseEntity<String> readGroupAliasById(String token, String id); ResponseEntity<String> deleteGroupByName(String token, String name); ResponseEntity<String> deleteGroupAliasByID(String token, String id); ResponseEntity<String> createGroupAlias(String token, GroupAliasRequest groupAliasRequest); ResponseEntity<String> getAuthUrl(OidcRequest oidcRequest); ResponseEntity<String> processOIDCCallback(String state, String code); ResponseEntity<String> getGroupObjectIdFromAzure(String groupName); ResponseEntity<String> getIdentityGroupDetails(String groupName, String token); ResponseEntity<String> getUserName(UserDetails userDetails); ResponseEntity<DirectoryObjects> searchGroupInAzureAD(String groupName);  }