I have a base class for all my integration tests, which is something like this :
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE)
@ContextConfiguration(classes = {Config1.class, Config2.class})
@TestPropertySource(properties = {
"zonky.test.database.postgres.docker.image=my-image",
"spring.profiles.active=test"
})
@AutoConfigureEmbeddedDatabase
public abstract class IntegrationTestBaseConfiguration {
}
Now, in each individual test class I have :
@ContextConfiguration(classes = {Config3.class})
class ConcreteIntegrationTest extends IntegrationTestBaseConfiguration {
//tests
}
I want to know if the context defined in the IntegrationTestBaseConfiguration is reused and shared among all my integration tests ?
If not, how can I achieve this ?