Closed vshenbag75 closed 10 months ago
I fear that ArchUnit currently (as of version 1.2.0) neither knows about throw
statements nor that a statement is within a catch
block, so I don't see a way how to write the test you're looking for.
Depending on your further contraints, there could be workarounds, though. Do your custom exceptions need constructors that don't take another exception? If not, you could write a rule preventing such constructors, and the violation wasn't possible anymore.
I would like to check re-throw or wrapping of exception propagate the exception to the higher level.
Example:
Expectation
Any idea how to handle using ArchUnit?