use of com.thinkbiganalytics.policy.validation.CreditCardValidator in project kylo by Teradata.
the class ValidatorTests method creditCardTests.
@Test
public void creditCardTests() {
CreditCardValidator validator = CreditCardValidator.instance();
Assert.assertTrue(validator.validate("4508242795214770"));
Assert.assertTrue(validator.validate("3534550235909500"));
Assert.assertTrue(validator.validate("3563436733386890"));
Assert.assertTrue(validator.validate("30485245023962"));
Assert.assertTrue(validator.validate("3559979696602300"));
Assert.assertTrue(validator.validate("3546330084792460"));
Assert.assertTrue(validator.validate("3571014044514510"));
Assert.assertTrue(validator.validate("30166467912021"));
Assert.assertTrue(validator.validate("4074771539744790"));
Assert.assertTrue(validator.validate("374283138983226"));
Assert.assertTrue(validator.validate("5100145505218790"));
Assert.assertTrue(validator.validate("30501574577558"));
Assert.assertFalse(validator.validate("676306013856639000"));
Assert.assertFalse(validator.validate("5018278895598920000"));
Assert.assertFalse(validator.validate("5602249431899030"));
Assert.assertFalse(validator.validate("5002353015111220"));
Assert.assertFalse(validator.validate("6771208405057810000"));
}
use of com.thinkbiganalytics.policy.validation.CreditCardValidator in project kylo by Teradata.
the class TestValidationTransformation method testCreditCardValidator.
@Test
public void testCreditCardValidator() {
CreditCardValidator validator = CreditCardValidator.instance();
FieldValidationRule uiModel = ValidatorAnnotationTransformer.instance().toUIModel(validator);
CreditCardValidator convertedValidator = fromUI(uiModel, CreditCardValidator.class);
Assert.assertEquals(validator, convertedValidator);
}
Aggregations