I am using @Reason Annotations so far to ensure the defect of my beans in Spring Configured Application.
To enable annotation, you need to declare the required annotation bin post processor bean in your configuration.
You do not declare it in your test configuration, so if some beans are not needed, then you have to keep them in your config.
I want to switch to less XML and use the note annotation, but this is required by default = true, which is fine for runtime configuration.
But according to my requirement, @ Atowold = false for the purpose of testing - keeping it necessary only for runtime.
Is this possible? I do not find any way to turn the required property to false.
Cheers
You have already solved it but this trick is for others Can be useful for
As far as I can understand without reference: annotation-driven should not be an ATOVAIRE annotation, processed but this is clearly not the case, However, I needed a quick solution ... This dirty trick first rejects the expected value for all classes, which was previously necessary. Adding it to my test reference has solved my problem, but it is only useful when all your business classes require all autovirings.
& lt; Bean class = "org.springframework .beans.factory.annotation.AutowiredAnnotationBeanPostProcessor" & gt; & Lt; Property Name = "Required Parameter Value" value = "False" /> & Lt; / Bean & gt;
Comments
Post a Comment