@Test public void givenBeanWithInvalidEmailConstraints_shouldNotValidate() { Customer customer = new Customer(); customer.setEmail("alex.theedom@example.co.uk"); Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer); assertThat(constraintViolations.size()).isEqualTo(1); }
public void setEmail(String email) { this.email = email; }
Customer { public void setEmail(String email) { this.email = email; } }
Customer { public void setEmail(String email) { this.email = email; }  }
Customer { 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); }
Customer { 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);  }