Verify calls using MockMvc in Spring

21 views Asked by At

I currently have a simple controller written in kotlin using spring. When hit, it will call ServiceA which will do some validation. If ServiceA throws an AccountNotFoundException, my controller has a RetryPolicy class that will be executed to retry.

However in my tests, I am finding it difficult to verify my RetryPolicy execution. Even though I can see that it is being run and executed, I can't verify it since my tests are all using autowired and not being mocked.

Is there a simple way in which I can verify that my RetryPolicy is being run in my spring test?

0

There are 0 answers