@Test public void containsBackSlashIsNotValid(){ ValidationResult projectIdValidationResult = validationToTest.validate("ab\\d"); assertFalse("Project id backslash forbidden, but accepted?!?", projectIdValidationResult.isValid()); }
@Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateNoUpperCaseCharacters(context); validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context, '-', '_'); }
ProjectIdValidationImpl extends AbstractSimpleStringValidation implements ProjectIdValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateNoUpperCaseCharacters(context); validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context, '-', '_'); } }
ProjectIdValidationImpl extends AbstractSimpleStringValidation implements ProjectIdValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateNoUpperCaseCharacters(context); validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context, '-', '_'); }  }
ProjectIdValidationImpl extends AbstractSimpleStringValidation implements ProjectIdValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateNoUpperCaseCharacters(context); validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context, '-', '_'); }   }
ProjectIdValidationImpl extends AbstractSimpleStringValidation implements ProjectIdValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateNoUpperCaseCharacters(context); validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context, '-', '_'); }   static final int PROJECTID_LENGTH_MIN; static final int PROJECTID_LENGTH_MAX; }