How to add inner classes to Spring application context for Unit Testing?
You need to make your inner class static
; Spring can't instantiate a non-static
inner class as a bean. If there really is a valid reason why it needs to be non-static
, you could create it manually in an @Bean
method.