use of org.openmrs.Address in project openmrs-core by openmrs.
the class PersonAddressValidatorTest method validate_shouldFailIfRequiredFieldsAreEmpty.
/**
* @see PersonAddressValidator#validate(Object, org.springframework.validation.Errors)
*/
@Test
public void validate_shouldFailIfRequiredFieldsAreEmpty() {
executeDataSet(PERSON_ADDRESS_VALIDATOR_DATASET_PACKAGE_PATH);
Address personAddress = new PersonAddress();
Errors errors = new BindException(personAddress, "personAddress");
validator.validate(personAddress, errors);
Assert.assertEquals(true, errors.hasErrors());
}
use of org.openmrs.Address in project openmrs-core by openmrs.
the class PersonAddressValidatorTest method validate_shouldPassIfRequiredFieldsAreNotEmpty.
/**
* @see PersonAddressValidator#validate(Object, org.springframework.validation.Errors)
*/
@Test
public void validate_shouldPassIfRequiredFieldsAreNotEmpty() {
executeDataSet(PERSON_ADDRESS_VALIDATOR_DATASET_PACKAGE_PATH);
Address personAddress = new PersonAddress();
personAddress.setAddress1("Address1");
Errors errors = new BindException(personAddress, "personAddress");
validator.validate(personAddress, errors);
Assert.assertEquals(false, errors.hasErrors());
}
Aggregations