Skip to content
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

Merged
merged 7 commits into from
Nov 5, 2021

Conversation

weidongxu-microsoft
Copy link
Member

@weidongxu-microsoft weidongxu-microsoft commented Oct 18, 2021

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.

@weidongxu-microsoft weidongxu-microsoft added Mgmt This issue is related to a management-plane library. Mgmt - Track 2 labels Oct 18, 2021
@weidongxu-microsoft weidongxu-microsoft self-assigned this Oct 18, 2021
@weidongxu-microsoft
Copy link
Member Author

weidongxu-microsoft commented Nov 3, 2021

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.

@weidongxu-microsoft
Copy link
Member Author

/azp run java - resourcemanager - ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -0,0 +1 @@
mock-maker-inline
Copy link
Member

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?

Copy link
Member Author

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.

@weidongxu-microsoft weidongxu-microsoft merged commit ac66c15 into Azure:main Nov 5, 2021
@weidongxu-microsoft weidongxu-microsoft deleted the mgmt_mock-sdk branch November 5, 2021 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt - Track 2 Mgmt This issue is related to a management-plane library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants