Search in sources :

Example 1 with RegexValidator

use of com.thinkbiganalytics.policy.validation.RegexValidator in project kylo by Teradata.

the class TestValidationTransformation method testRegexValidator.

@Test
public void testRegexValidator() {
    String regex = ".";
    RegexValidator validator = new RegexValidator(regex);
    FieldValidationRule uiModel = ValidatorAnnotationTransformer.instance().toUIModel(validator);
    RegexValidator convertedValidator = fromUI(uiModel, RegexValidator.class);
    Assert.assertEquals(regex, convertedValidator.getRegexExpression());
    Assert.assertEquals(regex, convertedValidator.getPattern().pattern());
}
Also used : RegexValidator(com.thinkbiganalytics.policy.validation.RegexValidator) FieldValidationRule(com.thinkbiganalytics.policy.rest.model.FieldValidationRule) Test(org.junit.Test)

Aggregations

FieldValidationRule (com.thinkbiganalytics.policy.rest.model.FieldValidationRule)1 RegexValidator (com.thinkbiganalytics.policy.validation.RegexValidator)1 Test (org.junit.Test)1