@Test public void givenBeanWithInvalidEmailConstraints_shouldNotValidate() { Person person = new Person(); person.setEmail("alex.theedom@example"); Set<ConstraintViolation<Person>> constraintViolations = validator.validate(person); assertThat(constraintViolations.size()).isEqualTo(0); }
public void setEmail(String email) { this.email = email; }
Person { public void setEmail(String email) { this.email = email; } }
Person { public void setEmail(String email) { this.email = email; }  }
Person { public void setEmail(String email) { this.email = email; }  String getFirstName(); void setFirstName(String firstName); String getSecondName(); void setSecondName(String secondName); String getEmail(); void setEmail(String email); }
Person { public void setEmail(String email) { this.email = email; }  String getFirstName(); void setFirstName(String firstName); String getSecondName(); void setSecondName(String secondName); String getEmail(); void setEmail(String email);  }