Continuing from #229, I stumbled upon this trying to register @Value (Spring)-annotated fields. Today only @Autowired and @Inject are allowed.
If there are good reasons for limiting the types of resources that can be registered on a fixture (I'm pretty new to this framework) then I'm all for but if not, I think that lesser restrictions (adding for instance @Value to the current allowed annotations or if possible pretty much just using reflection without specific boundaries, allowing more or less any kind of field to be registered on a fixture) would simplify/make the testing more powerful.
Thanks for sharing that thought with us @mickeelm. I'll ensure you we'll discuss this idea with the team internally. Any updates on our thoughts will be shared under this issue to notifying you asap.
Great! Let me know if I can be of any help with the implementation (if you decide on acting on the idea).
Hi @mickeelm, it is not that we decided to restrict the use of any way to inject resources, it's just that we do not want to rebuild the entire dependency injection framework our friends from Spring have built.
You are free to inject resources in whatever way you want. Simply implement the "ResourceInjector" interface and inject dependencies whichever way you want. By default, you get instances that use @Autowired and @Inject.
Currently, the fixtures don't allow configuration of custom resource injectors. That would be an addition we are definitely open to.
Most helpful comment
Great! Let me know if I can be of any help with the implementation (if you decide on acting on the idea).