-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable annotation engine as plugin #811
Conversation
Old interface is still there but is now deprecated in favor of the plugin extension point. Renamed DefaultAnnotationEngine as it was confusing ont the behavior, this engine only perform action on independent annotations. Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
It could be bypassed by Unsafe or other tricks. At this moment this is probably enough. Signed-off-by: Brice Dutheil <brice.dutheil@gmail.com>
Current coverage is 87.14% (diff: 100%)
|
For reference last commit skips
This part of the classloader test have some limitations, but it should be ok for simple tests. |
I suggest to review this PR commit by commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the way to go. Much better to configure this with the plugin mechanism. Implementations looks good!
Currently
AnnotationEngine
can be overrriden with the deprecatedMockitoConfiguration
, in order to be more consistent with the new way, I propose to get theAnnotationEngine
from thePluginRegistry
.Regarding backward compatible behavior, if the
MockitoConfiguration
class exists and can be seen then Mockito will select the engine of this configuration instead of thePlugins
one. IfMockitoConfiguration
class don't exist then Mockito wil chose thePlugins
one.Bonus I extended the classloader util to support some tests.