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

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

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


Copy link

@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
Copy link

@The-Alchemist 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.

Copy link

@The-Alchemist 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

No branches or pull requests

2 participants