pbarker
07/22/2024, 1:01 PMJsonViewTest trait in the views-json plugin?
My project uses this during integration tests but (Grails 4) it's now throwing an error:
Unsatisfied dependency expressed through field 'grails_plugin_json_view_test_JsonViewTest__messageSource'; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'org.springframework.context.MessageSource' available: expected single matching bean but found 2: messageSource,io.micronaut.spring.context.MicronautApplicationContext(Secondary)
The JsonViewTest trait does indeed have:
@Autowired(required = false)
MessageSource messageSource = new StaticMessageSource()
Anyone else come across this?pbarker
07/22/2024, 6:20 PMorg.grails:views-json-testing-support:{version} dependency and then implement in the test class using JsonViewUnitTest instead of JsonViewTest .pbarker
07/22/2024, 9:47 PMJsonViewUnitTest breaks dependency injection for ApplicationTagLib and AssetsTagLib.pbarker
07/23/2024, 9:55 AMJsonViewTest code into my own trait and replace the messageSource DI with my own, 'manually' obtained instance at runtime (in the test).