Ejemplo n.º 1
0
  @Test(expected = IllegalArgumentException.class)
  public void handlesRuntimeExceptionsCorrectly() {

    SampleDao dao = factory.getDao(SampleDao.class, new SampleCustomDaoImpl());
    dao.throwingRuntimeException();
  }
Ejemplo n.º 2
0
  @Test(expected = IOException.class)
  public void handlesCheckedExceptionsCorrectly() throws Exception {

    SampleDao dao = factory.getDao(SampleDao.class, new SampleCustomDaoImpl());
    dao.throwingCheckedException();
  }