/** * Method creates {@link FollowerContract} contract from dsl file where contract is described. * * @param fileName is path to dsl file with yaml structure of data for contract. * @return created and ready {@link FollowerContract} contract. * @throws IOException if something went wrong */ public static FollowerContract fromDslFile(String fileName) throws IOException { Yaml yaml = new Yaml(); try (FileReader r = new FileReader(fileName)) { Binder binder = Binder.from(DefaultBiMapper.deserialize((Map) yaml.load(r))); return new FollowerContract().initializeWithDsl(binder); } }