@Test public void shouldEncodeUnwiseCharsMixedWithOtherChars() { ConfigurableUnwiseCharsEncoder encoder = newUnwiseCharsEncoder("|,{,}"); String urlWithUnwiseChars = "/search.do?foo={&srsReport=Landing|AutoS|HOTEL|Hotel%20Il%20Duca%20D%27Este" + "|0|0|0|2|1|2|284128&srsr=Landing|AutoS|HOTEL|Hotel%20Il%20Duca%20D%27Este|0|0|0|2|1|2|284128"; assertThat(encoder.encode(urlWithUnwiseChars), is("/search.do?foo=%7B&srsReport=Landing%7CAutoS%7CHOTEL%7CHotel" + "%20Il%20Duca%20D%27Este%7C0%7C0%7C0%7C2%7C1%7C2%7C284128&srsr=Landing%7CAutoS%7CHOTEL%7CHotel%20Il%20" + "Duca%20D%27Este%7C0%7C0%7C0%7C2%7C1%7C2%7C284128")); }
@Override public String encode(String value) { String escaped = escaper.escape(value); if (!Objects.equals(escaped, value)) { logger.warn("Value contains unwise chars. you should fix this. raw={}, escaped={}: ", value, escaped); } return escaped; }
ConfigurableUnwiseCharsEncoder implements UnwiseCharsEncoder { @Override public String encode(String value) { String escaped = escaper.escape(value); if (!Objects.equals(escaped, value)) { logger.warn("Value contains unwise chars. you should fix this. raw={}, escaped={}: ", value, escaped); } return escaped; } }
ConfigurableUnwiseCharsEncoder implements UnwiseCharsEncoder { @Override public String encode(String value) { String escaped = escaper.escape(value); if (!Objects.equals(escaped, value)) { logger.warn("Value contains unwise chars. you should fix this. raw={}, escaped={}: ", value, escaped); } return escaped; } ConfigurableUnwiseCharsEncoder(String unwiseChars);  ConfigurableUnwiseCharsEncoder(StyxConfig config);  ConfigurableUnwiseCharsEncoder(StyxConfig config, Logger logger);  ConfigurableUnwiseCharsEncoder(String unwiseChars, Logger logger); }
ConfigurableUnwiseCharsEncoder implements UnwiseCharsEncoder { @Override public String encode(String value) { String escaped = escaper.escape(value); if (!Objects.equals(escaped, value)) { logger.warn("Value contains unwise chars. you should fix this. raw={}, escaped={}: ", value, escaped); } return escaped; } ConfigurableUnwiseCharsEncoder(String unwiseChars);  ConfigurableUnwiseCharsEncoder(StyxConfig config);  ConfigurableUnwiseCharsEncoder(StyxConfig config, Logger logger);  ConfigurableUnwiseCharsEncoder(String unwiseChars, Logger logger); @Override String encode(String value); }
ConfigurableUnwiseCharsEncoder implements UnwiseCharsEncoder { @Override public String encode(String value) { String escaped = escaper.escape(value); if (!Objects.equals(escaped, value)) { logger.warn("Value contains unwise chars. you should fix this. raw={}, escaped={}: ", value, escaped); } return escaped; } ConfigurableUnwiseCharsEncoder(String unwiseChars);  ConfigurableUnwiseCharsEncoder(StyxConfig config);  ConfigurableUnwiseCharsEncoder(StyxConfig config, Logger logger);  ConfigurableUnwiseCharsEncoder(String unwiseChars, Logger logger); @Override String encode(String value); static final String ENCODE_UNWISECHARS; }