/**
* Validating the model data which has correct values. Tests {@code @Address} constraint
*/
@Test
public void testAddressViolation() {
Person person = createValidPerson();
validateAddressConstraints(person);
// Setting city field of address.
person.getPersonAddress().setCity("Carolina");
validateAddressConstraints(person);
// Setting pin code equal to valid length of 6 characters.
person.getPersonAddress().setPinCode("123456");
person.getPersonAddress().setCity("Auckland");
validateAddressConstraints(person);
// Setting country name with valid length of more than 4 characters
person.getPersonAddress().setPinCode("123456");
person.getPersonAddress().setCountry("Mexico");
validateAddressConstraints(person);
}