I am using chaos monkey implementation of codeCentric to test a spring boot application. I want to simulate several behaviors. One of them is a read timeout from an external system. I thought, according to the behavior of my application, to have an exception thrown by a specific component to simulate this case. How can I specify that a given Spring Service should throw a custom Exception?
Asked
Active
Viewed 383 times
1
-
So when your code calls the external system you could catch and rethrow the exception as the kind you want, or alternatively you could use Springs exception handling ContollerAdvice if this is called through your RestService ... I think that is what you mean, but if not please clarify. – davesbrain Sep 28 '21 at 05:53