@groovy.transform.CompileStatic interface ApplicationContextResolver
Strategy interface for resolving an ApplicationContext from a Spock test invocation.
The DatabaseCleanup.resolver attribute allows users to specify a custom implementation of this interface for tests that store the application context in a non-standard location. The default implementation, DefaultApplicationContextResolver, covers the common cases (Groovy property, field reflection, and Spring TestContextManager).
Implementations must have a no-arg constructor so they can be instantiated by the framework.
| Type Params | Return Type | Name and description |
|---|---|---|
|
abstract ApplicationContext |
resolve(IMethodInvocation invocation)Resolves the ApplicationContext from the given Spock method invocation. |
Resolves the ApplicationContext from the given Spock method invocation.
invocation - the current Spock method invocation, providing access to the test instancenull if it cannot be resolved