@Test void shouldNotCreateAnArtistWithNullFirstname() { Artist artist = new Artist().firstName(null); tx.begin(); em.persist(artist); assertThrows(RollbackException.class, () -> tx.commit()); }
public Artist firstName(String firstName) { this.firstName = firstName; return this; }
Artist { public Artist firstName(String firstName) { this.firstName = firstName; return this; } }
Artist { public Artist firstName(String firstName) { this.firstName = firstName; return this; } Artist();  Artist(String firstName, String lastName, String email, String bio, LocalDate dateOfBirth); }
Artist { public Artist firstName(String firstName) { this.firstName = firstName; return this; } Artist();  Artist(String firstName, String lastName, String email, String bio, LocalDate dateOfBirth); Long getId(); String getFirstName(); void setFirstName(String firstName); Artist firstName(String firstName); String getLastName(); void setLastName(String lastName); Artist lastName(String lastName); String getEmail(); void setEmail(String email); Artist email(String email); String getBio(); void setBio(String bio); Artist bio(String bio); LocalDate getDateOfBirth(); void setDateOfBirth(LocalDate dateOfBirth); Artist dateOfBirth(LocalDate dateOfBirth); @Override String toString(); }
Artist { public Artist firstName(String firstName) { this.firstName = firstName; return this; } Artist();  Artist(String firstName, String lastName, String email, String bio, LocalDate dateOfBirth); Long getId(); String getFirstName(); void setFirstName(String firstName); Artist firstName(String firstName); String getLastName(); void setLastName(String lastName); Artist lastName(String lastName); String getEmail(); void setEmail(String email); Artist email(String email); String getBio(); void setBio(String bio); Artist bio(String bio); LocalDate getDateOfBirth(); void setDateOfBirth(LocalDate dateOfBirth); Artist dateOfBirth(LocalDate dateOfBirth); @Override String toString();  }