Hey all, is there any alternative to `mockkStatic`...
# mockk
m
Hey all, is there any alternative to
mockkStatic
? I'm having issues when running tests in parallel due to mocking using
mockkStatic
The only way I've managed to make it work was with
@Isolated
annotation at the top of each test class. TIA
e
since you mention
@Isolated
I'll assume you're using JUnit 5
in which case: no, there isn't
in principle, running each test in a separate classloader would prevent leaking static state (such as
mockkStatic
) between them. but while there were ways of achieving that in JUnit 4, there are not in JUnit 5. https://github.com/junit-team/junit5/issues/201
m
hmm bugger! Ok thanks @ephemient 🙏
230 Views