<@U0BUH9FRD> All my Spring Boot tests are fully wr...
# spring
p
@sdeleuze All my Spring Boot tests are fully written in Kotlin and I am having trouble with context caching. I was wondering how it's supposed to work. I have overall 2 different context (A, B), each has a few tests (denoted by numbers). It runs like this:
Copy code
Context A starts
Test A1 runs
Test A2 runs
Context B starts
Test B1 runs
Test B2 runs
Context A starts
Test A3 runs
Is this the expected behaviour? I was expecting Spring Boot to "group" the tests by context, but I guess it's just running in whatever order JUnit decided?
s
I think yes
d
Me too
p
Thanks
n
if you want to order your tests you need to use testng junit is for unit testing and hence assumes no order
p
I don't care about the order. I just expected the
SpringRunner
to be smart enough to properly order the tests to maximize context reuse.