@Test @Parameters(method = "specialCharacters") public void should_unescape_special_characters(String specialCharacters, String expectedEscaped) throws Exception { final String unescaped = new SpecialCharactersReplacer().unescape(expectedEscaped); assertThat(unescaped).isEqualTo(specialCharacters); }
public String unescape(String source) { String result = source.replaceAll("(?m)ape_special\\[(.[a-zA-Z0-9]*)]", "&$1;"); result = result.replace("ape_especial_curly_brackets_begin", "{"); result = result.replace("ape_especial_curly_brackets_end", "}"); return result; }
SpecialCharactersReplacer { public String unescape(String source) { String result = source.replaceAll("(?m)ape_special\\[(.[a-zA-Z0-9]*)]", "&$1;"); result = result.replace("ape_especial_curly_brackets_begin", "{"); result = result.replace("ape_especial_curly_brackets_end", "}"); return result; } }
SpecialCharactersReplacer { public String unescape(String source) { String result = source.replaceAll("(?m)ape_special\\[(.[a-zA-Z0-9]*)]", "&$1;"); result = result.replace("ape_especial_curly_brackets_begin", "{"); result = result.replace("ape_especial_curly_brackets_end", "}"); return result; }  }
SpecialCharactersReplacer { public String unescape(String source) { String result = source.replaceAll("(?m)ape_special\\[(.[a-zA-Z0-9]*)]", "&$1;"); result = result.replace("ape_especial_curly_brackets_begin", "{"); result = result.replace("ape_especial_curly_brackets_end", "}"); return result; }  String escape(String source); String unescape(String source); }
SpecialCharactersReplacer { public String unescape(String source) { String result = source.replaceAll("(?m)ape_special\\[(.[a-zA-Z0-9]*)]", "&$1;"); result = result.replace("ape_especial_curly_brackets_begin", "{"); result = result.replace("ape_especial_curly_brackets_end", "}"); return result; }  String escape(String source); String unescape(String source);  }