@Test(expected = ConstraintViolationException.class) public void airportCantBePersistedWithoutName() { airport.setName(null); entityManager().persist(airport); }
private void createAirport() { airport = new Airport(); airport.setName("Brussels Airport"); airport.setRegion(getRegion()); airport.setAddress(getAddress()); }