public static String toStringFromYamlFile(Object clazz, String resourcePath) throws URISyntaxException {
        try {
            URL resource = clazz.getClass().getResource(resourcePath);
            if (resource == null) {
                throw new FileNotFoundException("Couldn't find file: " + resourcePath);
            }

            byte[] bytes = Files.readAllBytes(Paths.get(resource.toURI()));
            return new String(bytes, StandardCharsets.UTF_8).replaceAll("\r\n?", "\n");
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        }
    }
Reads a resource from the classpath to use in asserting expected export content.
<p>
The resource is expected to be UTF-8 encoded.
<p>
Example usage:
<pre>{@code
toStringFromYamlFile(this, "expected-output.yml");}</pre>

@param clazz pass in {@code this}
@param resourcePath the file name to read, should be in the same package as your test class in resources
@return the string content of the file
@throws URISyntaxException if an invalid URI is passed.
test-harness/src/main/java/io/jenkins/plugins/casc/misc/Util.java