@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);
      String jsonStr = JSONUtil.getJSON(oidcEntityRequest);
    Response response = getMockResponse(HttpStatus.OK, true, "{\"data\": [\"safeadmin\",\"vaultadmin\"]]");
      ResponseEntity<String> responseEntityExpected = ResponseEntity.status(HttpStatus.OK)
              .body("{\"data\": [\"safeadmin\",\"vaultadmin\"]]");
      when(reqProcessor.process("/identity/entity/name/update", jsonStr, token)).thenReturn(response);
      
    when(OIDCUtil.updateEntityByName(token, oidcEntityRequest)).thenReturn(response);
    ResponseEntity<String> responseEntity = oidcAuthService.updateEntityByName(token, oidcEntityRequest);
    assertEquals(HttpStatus.OK, responseEntity.getStatusCode());
}