henrik
01/21/2022, 12:22 PM@RestController
class Foo(val bar: Bar, val baz: Baz = Baz("ding"))
bar
and baz
will be autowired automatically as expected. But is it possible to disable autowiring for baz
since it has a default value?Ties
01/21/2022, 12:34 PMTies
01/21/2022, 12:36 PMhenrik
01/21/2022, 12:57 PMhenrik
01/21/2022, 12:59 PMTies
01/21/2022, 1:00 PMTies
01/21/2022, 1:00 PMhenrik
01/21/2022, 1:04 PMSo it is a non-bean dependency, and you want to change it during testingYup. I was trying to avoid making it a bean, but it seems to be the only viable option. I was hoping for a
@DontAutowire
annotation or something 🙂Jacob
01/21/2022, 4:18 PMJacob
01/21/2022, 4:20 PM