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

GenerateMocks not working on class that GetxController #396

Closed
lifez opened this issue Apr 27, 2021 · 4 comments
Closed

GenerateMocks not working on class that GetxController #396

lifez opened this issue Apr 27, 2021 · 4 comments
Assignees
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@lifez
Copy link

lifez commented Apr 27, 2021

I have a class that extends GetxController from a library Getx and uses GenerateMocks but I have a problem with the screenshot below. Please advise.

Mockito: 5.0.5
Get: 4.1.4

Screen Shot 2021-04-27 at 15 48 53

@srawlins
Copy link
Member

_InternalFinalCallback is a private class so it cannot be faked. It is in the signatures of one of the methods of one of the classes being mocked in GenerateMocks.

Mockito should throw instead of generating this library.

@srawlins srawlins added P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Apr 28, 2021
@lifez
Copy link
Author

lifez commented Apr 28, 2021

@srawlins Yes exactly. I fork target library and change to the public, then it works!.

@lifez
Copy link
Author

lifez commented Apr 28, 2021

@srawlins So should we rename the title of this issue to "Throw errors If found the private class"?

I will help to contribute on this.

@srawlins srawlins self-assigned this Apr 28, 2021
srawlins added a commit that referenced this issue Apr 28, 2021
We prefer generally to use type alias names in order to match the user's code; extracting out the type signature may surprise users. However, given a private type alias, we can recover the situation by extracting out the type signature.

Fixes #396.

PiperOrigin-RevId: 370949384
@srawlins
Copy link
Member

Thanks for the info @lifez ; fixed in 5.0.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants