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

"No constructor in tested class that can be satisfied" if you have a @Injectable enum #173

Closed
The-Alchemist opened this Issue May 6, 2015 · 2 comments

Comments

2 participants
@The-Alchemist

The-Alchemist commented May 6, 2015

Caused by: java.lang.IllegalArgumentException: No constructor in tested class that can be satisfied by available injectables
.....
disregarded because parameter names are not available

I'm seeing this super strange error with a class that has a large constructor (8 params), and the last one is an enum. Based on some breakpoints I set, looks like parameter names are available.

I don't have a reproducible test case (yet), but I can see that in mockit.internal.state.ParameterNames.registerName(), parameterNames ends up looking like [db, httpClient, someAccount, clock, minimumSleepDurationInMs, testModeSettingValue, null]. That null is where the name of my enum variable should go.

In MethodOrConstructorVisitor.visitLocalVariable(), I see that previousDesc is Z. Not sure if that has anything to do with it.

The-Alchemist added a commit to The-Alchemist/jmockit1 that referenced this issue May 16, 2015

@The-Alchemist

This comment has been minimized.

Show comment
Hide comment
@The-Alchemist

The-Alchemist May 16, 2015

Could you consider reopening this issue?

I think I reproduced it, and I submitted a pull request to reproduce it (#175), along with instructions.

The-Alchemist commented May 16, 2015

Could you consider reopening this issue?

I think I reproduced it, and I submitted a pull request to reproduce it (#175), along with instructions.

@The-Alchemist

This comment has been minimized.

Show comment
Hide comment
@The-Alchemist

The-Alchemist May 16, 2015

@rliesenfeld : Thanks so much! :)

The-Alchemist commented May 16, 2015

@rliesenfeld : Thanks so much! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment