I have a weird Spring issue with Kotest, when I ru...
# kotest
d
I have a weird Spring issue with Kotest, when I run a test which uses the SpringExtension individually it works, but when I run the entire suite, it loads (I think) an application context only once and reuses it, causing some tests to fail. I only have ContextConfiguration and other sliced annotations wanting to minimize the application context for each test. I tried adding
@DirtiesContext
but to no avail. Any thoughts?
I think it might have had to do with
@AutoConfigureWireMock
from Spring Cloud contract's dependency, I replaced it with the Kotest Wiremock extension
o
Yes, you probably have to clear the invocations / stubs in wiremock after every test, and as far as I know this is handled by the wiremock extensions. Be aware of dirties context - this solution is more costly than clearing the data in database or reseting the state of wiremock. You should rather avoid using it, unless you really need it 🙂
d
I replaced it with the Kotest Wiremock extension, now it works, I think the other one just leaves some stuff behind
195 Views