@Test public void should_set_path_without_prefix_and_with_suffix() { assertThat(ContractVerifierUtil.fromRelativePath("validate_foo()")).isEqualTo("foo.yml"); assertThat(ContractVerifierUtil.fromRelativePath("validate_foo")).isEqualTo("foo.yml"); assertThat(ContractVerifierUtil.fromRelativePath("foo")).isEqualTo("foo.yml"); assertThat(ContractVerifierUtil.fromRelativePath("foo.yml")).isEqualTo("foo.yml"); }
static String fromRelativePath(String relativePath) { String path = relativePath; if (path.startsWith(TEST_METHOD_PREFIX)) { path = path.substring(TEST_METHOD_PREFIX.length()); } if (path.endsWith("()")) { path = path.replace("()", ""); } if (!path.endsWith(".yml")) { path = path + ".yml"; } return path; }
ContractVerifierUtil { static String fromRelativePath(String relativePath) { String path = relativePath; if (path.startsWith(TEST_METHOD_PREFIX)) { path = path.substring(TEST_METHOD_PREFIX.length()); } if (path.endsWith("()")) { path = path.replace("()", ""); } if (!path.endsWith(".yml")) { path = path + ".yml"; } return path; } }
ContractVerifierUtil { static String fromRelativePath(String relativePath) { String path = relativePath; if (path.startsWith(TEST_METHOD_PREFIX)) { path = path.substring(TEST_METHOD_PREFIX.length()); } if (path.endsWith("()")) { path = path.replace("()", ""); } if (!path.endsWith(".yml")) { path = path + ".yml"; } return path; } private  ContractVerifierUtil(); }
ContractVerifierUtil { static String fromRelativePath(String relativePath) { String path = relativePath; if (path.startsWith(TEST_METHOD_PREFIX)) { path = path.substring(TEST_METHOD_PREFIX.length()); } if (path.endsWith("()")) { path = path.replace("()", ""); } if (!path.endsWith(".yml")) { path = path + ".yml"; } return path; } private  ContractVerifierUtil(); static byte[] fileToBytes(Object testClass, String relativePath); static String valueFromXPath(Document parsedXml, String path); static Node nodeFromXPath(Document parsedXml, String path); static YamlContract contract(Object testClass, String relativePath); static ContractVerifierMap map(); }
ContractVerifierUtil { static String fromRelativePath(String relativePath) { String path = relativePath; if (path.startsWith(TEST_METHOD_PREFIX)) { path = path.substring(TEST_METHOD_PREFIX.length()); } if (path.endsWith("()")) { path = path.replace("()", ""); } if (!path.endsWith(".yml")) { path = path + ".yml"; } return path; } private  ContractVerifierUtil(); static byte[] fileToBytes(Object testClass, String relativePath); static String valueFromXPath(Document parsedXml, String path); static Node nodeFromXPath(Document parsedXml, String path); static YamlContract contract(Object testClass, String relativePath); static ContractVerifierMap map(); static final String TEST_METHOD_PREFIX; }