main/src/test/java/org/onap/policy/pap/main/rest/e2e/End2EndBase.java
/**
     * Loads an object from a JSON file.
     *
     * @param fileName name of the file from which to load
     * @param clazz the class of the object to be loaded
     * @return the object that was loaded from the file
     */
Loads an object from a JSON file.
@param fileName name of the file from which to load
@param clazz the class of the object to be loaded
@return the object that was loaded from the file
Loads an object from a JSON file . @param fileName name of the file from which to load @param clazz the class of the object to be loaded @return the object that was loaded from the file
protected static <T> T loadJsonFile(String fileName, Class<T> clazz) {
        String fileName2 = (fileName.startsWith("src/") ? fileName : "e2e/" + fileName);
        File propFile = new File(ResourceUtils.getFilePath4Resource(fileName2));
        try {
            T result = coder.decode(propFile, clazz);
            if (result == null) {
                throw new PolicyPapRuntimeException("cannot decode " + clazz.getSimpleName() + " from " + fileName);
            }
            return result;
        } catch (CoderException e) {
            throw new RuntimeException(e);
        }
    }
protected static < T > T loadJsonFile ( String fileName , Class < T > clazz ) { String fileName2 = ( fileName . startsWith ( "src/" ) ? fileName : "e2e/" + fileName ) ; File propFile = new File ( ResourceUtils . getFilePath4Resource ( fileName2 ) ) ; try { T result = coder . decode ( propFile , clazz ) ; if ( result == null ) { throw new PolicyPapRuntimeException ( "cannot decode " + clazz . getSimpleName ( ) + " from " + fileName ) ; } return result ; } catch ( CoderException e ) { throw new RuntimeException ( e ) ; } }
Loads an object from a JSON file.
Loads an object from a JSON file .