[Azure Blob Storage SDK] Client classes marked as final - making them unable to mock
See original GitHub issueHi,
Most (if not all) of the Azure Blob Storage SDK clients are marked as final, making it not possible (or overcomplicated) to write the tests with mocked client layer (e.g. with Mockito) - which seems to be a common use case.
Version
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.0.0-preview.2</version>
</dependency>
Solution Make the client classes non-final or provide client interfaces.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Unit testing and mocking with Azure SDK .NET
To create a test client instance, inherit from the client type and override methods you are calling in your code with an implementation...
Read more >How to mock a final class with mockito - java - Stack Overflow
Mockito checks the extensions directory for configuration files when it is loaded. This file enables the mocking of final methods and classes. Save...
Read more >Java Azure SDK Design Guidelines
A service client designation is only applied to classes that are able to be ... For example, a blob storage library developer may...
Read more >Spring Boot Reference Documentation
Build tool plugins: Maven | Gradle. Appendix: Application Properties | Configuration Metadata | Auto-configuration Classes | Test Auto-configuration Annotations ...
Read more >AZ-204 exam questions for FREE | Azure Developing solutions
The AZ-204 practice test covers all the topics you need to know for the AZ-204 exam, and it ... Process the messages and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Silvatre #5017 has discussions and potential solutions for mocking. It is missing direct mention for mocking final class and clients, I will work with @srnagar to add recommendations for those cases.
Thanks for working with Microsoft on GitHub! Tell us how you feel about your experience using the reactions on this comment.