use of uk.co.jemos.podam.test.dto.ValidatedPojo in project podam by devopsfolks.
the class ValidatedPojoTest method podamShouldFulfillMostOfTheJavaxValidationFramework.
@Test
@Title("Podam should be able to fulfill most of the javax Validation framework")
public void podamShouldFulfillMostOfTheJavaxValidationFramework() throws Exception {
AttributeStrategy<?> strategy = new EmailStrategy();
PodamFactory podamFactory = podamFactorySteps.givenAPodamFactoryWithCustomStrategy(Email.class, strategy);
ValidatedPojo pojo = podamInvocationSteps.whenIInvokeTheFactoryForClass(ValidatedPojo.class, podamFactory);
podamValidationSteps.theObjectShouldNotBeNull(pojo);
podamValidationSteps.theObjectShouldNotBeNull(pojo.getBoolFalse());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getBoolTrue());
podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo.getFilledString());
podamValidationSteps.theObjectShouldBeNull(pojo.getEmptyString());
podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo.getNotEmptyString());
podamValidationSteps.theStringFieldCannotBeNullOrEmpty(pojo.getNotBlankString());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getDecimalDouble());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getDecimalFloat());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getDecimalString());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getLongNumber());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getIntNumber());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getBigIntNumber());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getShortNumber());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getByteNumber());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getIntString());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getFractionDecimal());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getFractionString());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getPastDate());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getFutureCalendar());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getSizedString());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getMaxCollection());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getMinCollection());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getDefaultCollection());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getDefaultMap());
podamValidationSteps.theObjectShouldNotBeNull(pojo.getEmail());
podamValidationSteps.theObjectShouldBeNull(pojo.getIdentifier());
Validator validator = podamFactorySteps.givenAJavaxValidator();
validatorSteps.thePojoShouldNotViolateAnyValidations(validator, pojo);
podamFactorySteps.removeCustomStrategy(podamFactory, Email.class);
}
Aggregations