@Test public void itShouldThrowWhenHandicapGroupIsNull() { RegistrationHibernateEntity entity = buildUnsavedRegistration(); entity.setHandicapGroup(null); try { daoTestRule.inTransaction(() -> dao.create(entity)); failBecauseExceptionWasNotThrown(PersistenceException.class); } catch (Exception e) { assertThat(e) .isInstanceOf(PersistenceException.class) .hasCauseInstanceOf(ConstraintViolationException.class); } }
@Override public void create(RegistrationHibernateEntity registration) { persist(registration); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); @Override RegistrationHibernateEntity findById(String id); List<RegistrationHibernateEntity> getAllWith(EventHibernateEntity event); @Override void create(RegistrationHibernateEntity registration); @Override List<RegistrationHibernateEntity> findAll(); }
RegistrationDao extends BaseHibernateEntityDao<RegistrationHibernateEntity> { @Override public void create(RegistrationHibernateEntity registration) { persist(registration); } @Inject  RegistrationDao(SessionFactory sessionFactory); @Override RegistrationHibernateEntity findById(String id); List<RegistrationHibernateEntity> getAllWith(EventHibernateEntity event); @Override void create(RegistrationHibernateEntity registration); @Override List<RegistrationHibernateEntity> findAll();  }