JobDaoImpl implements JobDao, HasIntCrud<Job> { @Override public boolean delete(int id) { return genericDao.delete(id); } @Inject  JobDaoImpl(final JobDbConnProvider jobDbConnProvider); @Override Job create(@Nonnull final Job job); @Override Job update(@Nonnull final Job job); @Override boolean delete(int id); @Override Optional<Job> fetch(int id); @Override ResultPage<Job> find(FindJobCriteria criteria); @Override int deleteOrphans();  }
@Test void delete() { Job job = createStandardJob(); boolean didDeleteSucceed = dao.delete(job.getId()); assertThat(didDeleteSucceed).isTrue(); Optional<Job> optionalJob = dao.fetch(job.getId()); assertThat(optionalJob.isPresent()).isFalse(); }
@Test void badDelete() { boolean didDeleteSucceed = dao.delete(111111); assertThat(didDeleteSucceed).isFalse(); }