Skip to content

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

@The-Alchemist

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions