|
@@ -51,6 +51,7 @@ import org.springframework.web.context.support.AnnotationConfigWebApplicationCon
|
|
* @author Rob Winch
|
|
* @author Rob Winch
|
|
*/
|
|
*/
|
|
abstract class BaseSpringSpec extends Specification {
|
|
abstract class BaseSpringSpec extends Specification {
|
|
|
|
+ boolean allowCircularReferences = false
|
|
@AutoCleanup
|
|
@AutoCleanup
|
|
ConfigurableApplicationContext context
|
|
ConfigurableApplicationContext context
|
|
@AutoCleanup
|
|
@AutoCleanup
|
|
@@ -89,6 +90,7 @@ abstract class BaseSpringSpec extends Specification {
|
|
|
|
|
|
def loadConfig(Class<?>... configs) {
|
|
def loadConfig(Class<?>... configs) {
|
|
context = new AnnotationConfigWebApplicationContext()
|
|
context = new AnnotationConfigWebApplicationContext()
|
|
|
|
+ context.setAllowCircularReferences(allowCircularReferences)
|
|
context.register(configs)
|
|
context.register(configs)
|
|
context.setServletContext(new MockServletContext())
|
|
context.setServletContext(new MockServletContext())
|
|
context.refresh()
|
|
context.refresh()
|
|
@@ -169,4 +171,4 @@ abstract class BaseSpringSpec extends Specification {
|
|
def getObjectPostProcessor() {
|
|
def getObjectPostProcessor() {
|
|
oppContext.getBean(ObjectPostProcessor)
|
|
oppContext.getBean(ObjectPostProcessor)
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|