use of org.hibernate.validator.testutil.MyCustomStringImpl in project hibernate-validator by hibernate.
the class EmailValidatorTest method testValidEmailCharSequence.
@Test
@TestForIssue(jiraKey = "HV-502")
public void testValidEmailCharSequence() throws Exception {
isValidEmail(new MyCustomStringImpl("emmanuel@hibernate.org"));
isInvalidEmail(new MyCustomStringImpl("@example.com"));
}
use of org.hibernate.validator.testutil.MyCustomStringImpl in project hibernate-validator by hibernate.
the class LuhnCheckValidatorTest method testFailOnNonNumeric.
@Test
public void testFailOnNonNumeric() throws Exception {
LuhnCheckValidator validator = new LuhnCheckValidator();
LuhnCheck modCheck = createLuhnCheckAnnotation(0, Integer.MAX_VALUE, -1, false);
validator.initialize(modCheck);
assertFalse(validator.isValid(new MyCustomStringImpl("A79927398713"), null));
}
use of org.hibernate.validator.testutil.MyCustomStringImpl in project hibernate-validator by hibernate.
the class LuhnCheckValidatorTest method testIgnoreNonNumeric.
@Test
public void testIgnoreNonNumeric() throws Exception {
LuhnCheckValidator validator = new LuhnCheckValidator();
LuhnCheck modCheck = createLuhnCheckAnnotation(0, Integer.MAX_VALUE, -1, true);
validator.initialize(modCheck);
assertTrue(validator.isValid(new MyCustomStringImpl("A79927398713"), null));
}
use of org.hibernate.validator.testutil.MyCustomStringImpl in project hibernate-validator by hibernate.
the class Mod10CheckValidatorTest method testInvalidMod10.
@Test
public void testInvalidMod10() throws Exception {
Mod10CheckValidator validator = new Mod10CheckValidator();
Mod10Check modCheck = createMod10CheckAnnotation(0, Integer.MAX_VALUE, -1, false);
validator.initialize(modCheck);
assertFalse(validator.isValid(new MyCustomStringImpl("79927398713"), null));
}
use of org.hibernate.validator.testutil.MyCustomStringImpl in project hibernate-validator by hibernate.
the class Mod10CheckValidatorTest method testValidIdentcode.
@Test
@TestForIssue(jiraKey = "HV-813")
public void testValidIdentcode() throws Exception {
Mod10CheckValidator validator = new Mod10CheckValidator();
Mod10Check modCheck = createMod10CheckAnnotation(0, Integer.MAX_VALUE, -1, true, 4, 9);
validator.initialize(modCheck);
assertTrue(validator.isValid(new MyCustomStringImpl("56.310 243.031 3"), null));
}
Aggregations