-
Notifications
You must be signed in to change notification settings - Fork 736
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
Unable to mock GHObject#id #1739
Comments
Seems related: mockito/mockito#701 |
We had the issue with the Quarkus GitHub API extension + Mockito when we developed Quarkus GitHub App and Quarkus GitHub Action and we couldn't find any good workaround. Mockito and/or ByteBuddy randomly choose one of the method and you end up with flaky tests. Our solution in this context has been to drop the bridge methods from the bytecode using some Quarkus build time magic. They are only intended for binary compatibility and in a Quarkus environment, people would have to rebuild their app after an upgrade anyway. But obviously, this cannot be applied in all environments. In other words, you are not alone :). |
@gsmet thanks for the feedback, that's very unfortunate. There are so many issues due to this back-compatibility thing firing back, that the whole experience of using this library reminds me of the "jumping on a rake" meme. |
mockito/mockito#701 was closed a while ago. @gsmet |
I'm working on publishing a However, I haven't gotten it to work yet. https://github.com/hub4j/github-api/actions/runs/6968301386 |
@bitwiseman let me know if I could help with fixing that |
@Haarolean @gsmet https://github.com/hub4j/github-api/actions/runs/6987836071 |
Thank you very much, it works! @bitwiseman should we close this? |
@Haarolean |
Sure, I'll raise a PR then |
Hi,
it seems like it's impossible to mock
GHObject
via Mockito, I observe this behavior:The exception:
I believe this may be related to bridge methods, but I have no idea how to implement a workaround.
Could you please elaborate if this is possible?
The text was updated successfully, but these errors were encountered: