Hey! I try to run my integration tests, and one of my tests uses @SpyBean.

When I run my test alone everything is ok, but when I run this test together with others, I face:

Actually, there were zero interactions with this mock

I tried to use @DirtiesContext on this test, but it doesn't work at all.

Only spring.test.context.cache.maxSize=1 helped me.

Tell me please, what is the root cause of that?

And is it possible to solve it better?

Comment From: sbrannen

Hi @MaxBartkov,

In order to assist you, you will have to provide us a concrete example which demonstrates the problem -- for example, a single test class that reproduces the issue or a sample project that we can download (such as a GitHub repository or ZIP file).

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.