use of uk.co.jemos.podam.test.dto.ValidatedPatternPojo in project podam by devopsfolks.
the class ValidatedPojoTest method podamShouldAllowValidationAnnotationsCustomization.
@Test
@Title("Podam should allow validation annotations customization")
public void podamShouldAllowValidationAnnotationsCustomization() throws Exception {
AttributeStrategy<?> strategy = new PatternStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomStrategy(Pattern.class, strategy);
ValidatedPatternPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ValidatedPatternPojo.class, podamFactory);
podamValidationSteps.thePojoMustBeOfTheType(pojo, ValidatedPatternPojo.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getNumber(), String.class);
podamValidationSteps.thePojoMustBeOfTheType(pojo.getIdentifier(), String.class);
Validator validator = podamFactorySteps.givenAJavaxValidator();
validatorSteps.thePojoShouldNotViolateAnyValidations(validator, pojo);
podamFactorySteps.removeCustomStrategy(podamFactory, Pattern.class);
}
Aggregations