How does 'gradle test' starts Spring Application contexts?

(Fedor Belov) #1

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?

(uklance) #2

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.

(Fedor Belov) #3

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