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

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

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