use of org.openmrs.EncounterRole in project openmrs-core by openmrs.
the class EncounterRoleValidatorTest method validate_shouldPassEditingEncounterRoleName.
/**
* {@link org.openmrs.validator.EncounterRoleValidator#validate(Object, org.springframework.validation.Errors)}
*/
@Test
public void validate_shouldPassEditingEncounterRoleName() {
EncounterRole encounterRole = Context.getEncounterService().getEncounterRoleByName("Unknown");
Assert.assertNotNull(encounterRole);
encounterRole.setName("Lab");
encounterRole.setDescription("desc");
Errors errors = new BindException(encounterRole, "encounterRole");
new EncounterRoleValidator().validate(encounterRole, errors);
Assert.assertFalse(errors.hasErrors());
}
use of org.openmrs.EncounterRole in project openmrs-core by openmrs.
the class RequireNameValidatorTest method validate_shouldPassValidationIfNameHasProperValue.
/**
* @see RequireNameValidator#validate(Object,Errors)
*/
@Test
public void validate_shouldPassValidationIfNameHasProperValue() {
EncounterRole role = new EncounterRole();
role.setName("restraining");
Errors errors = new BindException(role, "type");
new RequireNameValidator().validate(role, errors);
Assert.assertFalse(errors.hasErrors());
}
Aggregations