Ninja-Squad/springmockk

Spring boot 3.0.4: New Test Application context is created for every new IT class when using Kotlin Mock beans

kaushalsingh861 opened this issue · 1 comments

It seems that new spring context is created for every new IT class, when using Mock Beans.
I have created an abstract @SpringBootTest class, and created two child classes for test. when using Mock beans, new application context is created for both the classes.
When the mock beans are commented out, the context is reused.

I have created an sample application to reproduce this issue here: https://github.com/kaushalsingh861/demo

I am not sure if this is a bug in spring, so I have created an ticket at Spring project as well spring-projects/spring-boot#34645

So this happens with Mockito as well. (both with MockBean and SpyBean). I will report this to spring project.