src/main/java/com/janeirodigital/mockwebserver/Fixture.java
/**
     * Parse the given filename and returns the Fixture object.
     *
     * @param fileName filename should not contain extension or relative path. ie: login
     * @param parser   parser is required for parsing operation, it should not be null
     */
Parse the given filename and returns the Fixture object.
@param fileName filename should not contain extension or relative path. ie: login
@param parser   parser is required for parsing operation, it should not be null
Parse the given filename and returns the Fixture object . @param fileName filename should not contain extension or relative path . ie : login @param parser parser is required for parsing operation it should not be null
public static Fixture parseFrom(String fileName, Parser parser, RecordedRequest request) {
        if (fileName == null) {
            throw new NullPointerException("File name should not be null");
        }
        String path = "fixtures/" + fileName + ".yaml";
        Map<String, String> variables = new HashMap<>();
        variables.put("SERVER_BASE", getServerBaseFromRequest(request));
        StringSubstitutor substitutor = new StringSubstitutor(variables);
        try {
            return parser.parse(substitutor.replace(readPathIntoString(path)));
        } catch (IOException ex) {
            throw new IllegalStateException("Test Harness: Error reading from " + path + ": " + Arrays.toString(ex.getStackTrace()));
        }
    }
public static Fixture parseFrom ( String fileName , Parser parser , RecordedRequest request ) { if ( fileName == null ) { throw new NullPointerException ( "File name should not be null" ) ; } String path = "fixtures/" + fileName + ".yaml" ; Map < String , String > variables = new HashMap < > ( ) ; variables . put ( "SERVER_BASE" , getServerBaseFromRequest ( request ) ) ; StringSubstitutor substitutor = new StringSubstitutor ( variables ) ; try { return parser . parse ( substitutor . replace ( readPathIntoString ( path ) ) ) ; } catch ( IOException ex ) { throw new IllegalStateException ( "Test Harness: Error reading from " + path + ": " + Arrays . toString ( ex . getStackTrace ( ) ) ) ; } }
Parse the given filename and returns the Fixture object.
Parse the given filename and returns the Fixture object .