-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Repeat: Java generation: allow non-final generation for classes #16793
Comments
I agree - it would be excellent to be able to mock. The only response I've gotten in the past from google devs (not protobuf, though) as to why the classes are marked final is because they wanted to ensure users of their libraries don't use inheritance on those classes. That response feels like using a Nuke to remove the tree stump in the back yard to me. However, even that can be solved - using interfaces. Wasn't finding any common ground / interest in working on the matter, so I gave up. |
As mentioned on #11162 follow-up, this request may belong on a gRPC project instead of this one. Sorry that I don't know the right project to link here myself. Is this the plugin invloved? https://github.com/xolstice/protobuf-maven-plugin Looking at the plugin briefly, I did not find references to the grpc/protobuf code generators themselves. Hope this helps. |
Yep, I think I posted to the wrong project. I'll make sure to re-post to the right one. However, I think the design issue is systemic - unit tests should be able to mock generated classes. Even Any, Empty etc should be mockable but user classes should be mockable without question. |
I agree that generated model objects should be inheritable (and, hence, not @carojkov if you |
Thanks, I am sure adding voices makes a differenced. |
re: #11162
Allow mocking stubs - don't make them final
I'd love to be able to mock stubs
@MarinaShaposhnikova
@artnaseef
The text was updated successfully, but these errors were encountered: