public static ErrorResponse fromJson(int code, String json) {
    return JsonUtil.parse(json, node -> OAuthErrorResponseParser.fromJson(code, node));
  }
@Test
  public void testOAuthErrorResponseFromJson() {
    String error = OAuth2Properties.INVALID_CLIENT_ERROR;
    String description = "Credentials given were invalid";
    String uri = "http://iceberg.apache.org";
    String json =
        String.format(
            "{\"error\":\"%s\",\"error_description\":\"%s\",\"error_uri\":\"%s\"}",
            error, description, uri);
    ErrorResponse expected =
        ErrorResponse.builder().responseCode(400).withType(error).withMessage(description).build();
    assertEquals(expected, OAuthErrorResponseParser.fromJson(400, json));
  }