private String loadJson(final String resourceName) throws IOException {
    final String path = "/json/" + resourceName;
    final URL url = this.getClass().getResource(path);
    final File testJson = new File(url.getFile());
    final String jsonText =
        FileUtils.readFileToString(testJson, StandardCharsets.UTF_8);
    return jsonText.replaceAll("\\s+", "");
  }
Accepts a file name and loads it from /src/test/resource/json

@param resourceName The name of the file to load
@return A JSON string, all whitespace removed
@throws IOException Failed to load the file
serde/src/test/org/apache/hadoop/hive/serde2/TestJsonSerDe.java