@Test public void whenCreateWithoutCompetitionGroupSetItShouldThrow() { EventHibernateEntity entity = buildUnsavedEvent(); entity.setCompetitionGroupSet(null); try { daoTestRule.inTransaction(() -> dao.create(entity)); failBecauseExceptionWasNotThrown(ConstraintViolationException.class); } catch (ConstraintViolationException e) { assertThat(e.getMessage()) .containsIgnoringCase("competitionGroupSet") .containsIgnoringCase("null"); } }
@Override public void create(EventHibernateEntity event) { persist(event); }
EventDao extends BaseHibernateEntityDao<EventHibernateEntity> { @Override public void create(EventHibernateEntity event) { persist(event); } }
EventDao extends BaseHibernateEntityDao<EventHibernateEntity> { @Override public void create(EventHibernateEntity event) { persist(event); } @Inject  EventDao(SessionFactory sessionFactory); }
EventDao extends BaseHibernateEntityDao<EventHibernateEntity> { @Override public void create(EventHibernateEntity event) { persist(event); } @Inject  EventDao(SessionFactory sessionFactory); @Override EventHibernateEntity findById(String id); @Override List<EventHibernateEntity> findAll(); @Override void create(EventHibernateEntity event); }
EventDao extends BaseHibernateEntityDao<EventHibernateEntity> { @Override public void create(EventHibernateEntity event) { persist(event); } @Inject  EventDao(SessionFactory sessionFactory); @Override EventHibernateEntity findById(String id); @Override List<EventHibernateEntity> findAll(); @Override void create(EventHibernateEntity event);  }