Leverage non-default ctor support in Kotlin bean DSL
Since non-default constructors are now evaluated for autowiring, there is no need anymore for setting autowiring mode or exposing it in Kotlin bean DSL. Issue: SPR-17292
This commit is contained in:
@@ -143,6 +143,19 @@ class BeanDefinitionDslTests {
|
||||
val barbar = context.getBean<BarBar>()
|
||||
assertEquals(2, barbar.foos.size)
|
||||
}
|
||||
|
||||
@Test // SPR-17292
|
||||
fun `Declare beans leveraging constructor injection`() {
|
||||
val beans = beans {
|
||||
bean<Bar>()
|
||||
bean<Baz>()
|
||||
}
|
||||
val context = GenericApplicationContext().apply {
|
||||
beans.initialize(this)
|
||||
refresh()
|
||||
}
|
||||
context.getBean<Baz>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user