@Test public void a_token_containing_only_40_chars_is_valid() { StringBuilder sb = new StringBuilder(); for (int i=0;i<40;i++) { sb.append('A'); } assertTrue(validationToTest.validate(sb.toString()).isValid()); }
@Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context); }
OneTimeTokenValidationImpl extends AbstractSimpleStringValidation implements OneTimeTokenValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context); } }
OneTimeTokenValidationImpl extends AbstractSimpleStringValidation implements OneTimeTokenValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context); }  }
OneTimeTokenValidationImpl extends AbstractSimpleStringValidation implements OneTimeTokenValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context); }   }
OneTimeTokenValidationImpl extends AbstractSimpleStringValidation implements OneTimeTokenValidation { @Override protected void validate(ValidationContext<String> context) { validateNotNull(context); if (context.isInValid()) { return; } validateSameLengthWhenTrimmed(context); validateLength(context); validateOnlyAlphabeticDigitOrAllowedParts(context); }    }