-
Notifications
You must be signed in to change notification settings - Fork 2k
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
mgmt, sample for mock sdk #24849
mgmt, sample for mock sdk #24849
Conversation
README will be updated later. I first need to put the files into repo so the README can refer to them without CI report url-not-found error. |
/azp run java - resourcemanager - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -0,0 +1 @@ | |||
mock-maker-inline |
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.
why is this file under test/resources folder rather than sample/resources folder?
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.
this is for enabling feature on mockito to enable mocking of final class.
see https://github.com/Azure/azure-sdk-for-java/wiki/Unit-Testing#mocking-final-classes and its reference to mockito.
The most desirable approach for mocking Fluent API would be the “Mockito.RETURNS_DEEP_STUBS” provided by Mockito.
However some of the interfaces involved in our API uses generic, and due to type erasure Mockito will not able to handle them. Hence we still need to use the full declaration on every step of the Fluent API.