コード例 #1
0
  @Test(expected = IOException.class)
  public void handlesCheckedExceptionsCorrectly() throws Exception {

    SampleRepository repository =
        factory.getRepository(SampleRepository.class, new SampleCustomRepositoryImpl());
    repository.throwingCheckedException();
  }
コード例 #2
0
  @Test(expected = IllegalArgumentException.class)
  public void handlesRuntimeExceptionsCorrectly() {

    SampleRepository repository =
        factory.getRepository(SampleRepository.class, new SampleCustomRepositoryImpl());
    repository.throwingRuntimeException();
  }