@Test public void isValid() { assertTrue(replaceCharacterValidator.isValid("test")); assertTrue(replaceCharacterValidator.isValid("tést")); assertTrue(replaceCharacterValidator.isValid("test with âccents/and.special%characters")); assertTrue(replaceCharacterValidator.isValid("test with accents and special characters")); assertTrue(replaceCharacterValidator.isValid("test-with-accents-and-special-characters")); this.replaceCharacterValidator.setReplacementCharacters(Collections.singletonMap("/", " ")); assertTrue(replaceCharacterValidator.isValid("test")); assertTrue(replaceCharacterValidator.isValid("tést")); assertFalse(replaceCharacterValidator.isValid("test with âccents/and.special%characters")); assertTrue(replaceCharacterValidator.isValid("test with accents and special characters")); assertTrue(replaceCharacterValidator.isValid("test-with-accents-and-special-characters")); this.replaceCharacterValidator.setReplacementCharacters(Collections.singletonMap("/", null)); assertTrue(replaceCharacterValidator.isValid("test")); assertTrue(replaceCharacterValidator.isValid("tést")); assertFalse(replaceCharacterValidator.isValid("test with âccents/and.special%characters")); assertTrue(replaceCharacterValidator.isValid("test with accents and special characters")); assertTrue(replaceCharacterValidator.isValid("test-with-accents-and-special-characters")); Map<String, String> replaceMap = new HashMap<>(); replaceMap.put("/", null); replaceMap.put(" ", "-"); replaceMap.put("%", "-"); this.replaceCharacterValidator.setReplacementCharacters(replaceMap); assertTrue(replaceCharacterValidator.isValid("test")); assertTrue(replaceCharacterValidator.isValid("tést")); assertFalse(replaceCharacterValidator.isValid("test with âccents/and.special%characters")); assertFalse(replaceCharacterValidator.isValid("test with accents and special characters")); assertTrue(replaceCharacterValidator.isValid("test-with-accents-and-special-characters")); }
@Override public boolean isValid(String name) { return !StringUtils.containsAny(name, this.forbiddenCharacters); }
ReplaceCharacterEntityNameValidation extends AbstractEntityNameValidation implements Initializable { @Override public boolean isValid(String name) { return !StringUtils.containsAny(name, this.forbiddenCharacters); } }
ReplaceCharacterEntityNameValidation extends AbstractEntityNameValidation implements Initializable { @Override public boolean isValid(String name) { return !StringUtils.containsAny(name, this.forbiddenCharacters); }  }
ReplaceCharacterEntityNameValidation extends AbstractEntityNameValidation implements Initializable { @Override public boolean isValid(String name) { return !StringUtils.containsAny(name, this.forbiddenCharacters); }  @Override void initialize(); void setReplacementCharacters(Map<String, String> replacementMap); @Override String transform(String name); @Override boolean isValid(String name); }
ReplaceCharacterEntityNameValidation extends AbstractEntityNameValidation implements Initializable { @Override public boolean isValid(String name) { return !StringUtils.containsAny(name, this.forbiddenCharacters); }  @Override void initialize(); void setReplacementCharacters(Map<String, String> replacementMap); @Override String transform(String name); @Override boolean isValid(String name);  }