EventDao extends BaseHibernateEntityDao<EventHibernateEntity> { @Override public List<EventHibernateEntity> findAll() { return list(namedQuery(EventHibernateEntity.QUERY_FIND_ALL)); } @Inject  EventDao(SessionFactory sessionFactory); @Override EventHibernateEntity findById(String id); @Override List<EventHibernateEntity> findAll(); @Override void create(EventHibernateEntity event);  }
@Test public void whenFindAllItShouldReturnEmpty() { daoTestRule.inTransaction(() -> { List<EventHibernateEntity> actual = dao.findAll(); assertThat(actual) .isNotNull() .isEmpty(); }); }