How does 'gradle test' starts Spring Application contexts?

I’ve got two Spock Framework classes which should starts different Spring application contexts. Why I run them from Intellij IDEA it works without problems. When I run them by ‘gradle test’ it looks like only one application context is started and used by both classes.

How does spock starts Spring application contexts? One per month / one per class / one for all tests?

Once per month? :wink:

Can you share the code that instantiates the ApplicationContext? Possibly you’re initializing a static variable which could cause the “bleed” you’re seeing.

Looks like Gradle starts single applicationContext for all tests if all tests has same Spring configuration and active profile