@Test public void testMiddleName(){ User user = getAValidUser(); user.setMiddleName(null); assertFalse(hasViolations(user)); user.setMiddleName(""); assertFalse(hasViolations(user)); user.setMiddleName(new String(new char[1_000])); assertTrue(hasViolations(user)); }
public void setMiddleName(String middleName) { this.middleName = middleName; }
User { public void setMiddleName(String middleName) { this.middleName = middleName; } }
User { public void setMiddleName(String middleName) { this.middleName = middleName; } User(); }
User { public void setMiddleName(String middleName) { this.middleName = middleName; } User(); Long getId(); void setId(Long id); String getName(); void setName(String name); String getMiddleName(); void setMiddleName(String middleName); String getSurname(); void setSurname(String surname); LocalDate getDateOfRegistration(); void setDateOfRegistration(LocalDate dateOfRegistration); LocalDate getDateOfBirth(); void setDateOfBirth(LocalDate dateOfBirth); String getEmail(); void setEmail(String email); }
User { public void setMiddleName(String middleName) { this.middleName = middleName; } User(); Long getId(); void setId(Long id); String getName(); void setName(String name); String getMiddleName(); void setMiddleName(String middleName); String getSurname(); void setSurname(String surname); LocalDate getDateOfRegistration(); void setDateOfRegistration(LocalDate dateOfRegistration); LocalDate getDateOfBirth(); void setDateOfBirth(LocalDate dateOfBirth); String getEmail(); void setEmail(String email);  }