I know that you can simply inject a service in unit test method using:
defineBeans {
someService(SomeService)
}
But when I need to inject se
To use spring beans in a unit test you need to do the following:
defineBeans
closure.autowire
property to true
for beans that need to have other beans injected.For example:
defineBeans {
someService(SomeService) { bean ->
bean.autowire = true
}
some2Service(Some2Service)
}