I would like to write test for a controller class. The controller class takes a service object as constructor parameter. Added the @Inject annotation to the constructor of the service class.
class AssociateService @Inject()(configuration: Configuation){...}
The constructor parameter of the service class is a custom configuration object also created for the application. I added the @Inject to the constructor of the config class as well. Now I'm getting these types of error messages:
No implementation for "className" was bound.
Could not find a suitable constructor in java.lang.Integer. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
The configuration class has several constructor parameters, those are "basic" types (Int, Boolean) and one parameter is a custom class type (className). How should I do this binding or is it just enough to annotate something else? And why it says that constructor error message?