Summary
In my test the method call should pass if none exception is throwed, but if the ThrowingCallable doesn't throw anything an assertion error happens
Example
@Test
@DisplayName("Should Delete a person by CPF and then save another person with this cpf")
void shouldDeleteAPersonByCPFAndThenSaveAnotherPersonWithThisCPF() {
assertThatThrownBy(() -> { service.batchOperationByCPF(CPF); }).doesNotThrowAnyException();
}
Am I doing something wrong?
java.lang.AssertionError:
Expecting code to raise a throwable.
at com.dtb.jpadeletetest.service.PersonServiceIT.shouldDeleteAPersonByCPFAndThenSaveAnotherPersonWithThisCPF(PersonServiceIT.java:38)
Summary
In my test the method call should pass if none exception is throwed, but if the ThrowingCallable doesn't throw anything an assertion error happens
Example
Am I doing something wrong?