Olá,
Um pouco de testes… Estou usando Junit.
Eu sei que é possível verificar se uma exceção foi lançada, através do teste.
Dessa forma:
if (...)
throw new IllegalArgumentException();
@Test(expected = IllegalArgumentException.class)
myTest() {...}
Agora eu pergunto, é possível através do teste, saber que ocorreu uma exceção, mas ja foi tratada?
if (...)
try {
throw new IllegalArgumentException();
} catch (Exception e) {
tratando a excecao
}
PS: talvez eu esteja viajando!
Abraço