You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using cdi-unit the implementation classes are not discovered by default.
In our code base we have a guide line to use interfaces for all service classes.
All fields use the interface type.
This means, we need to manually add all required classes via annotations.
That is cumbersome and not useful.
Can we have a new feature, that cdi-unit finds and injects the implementations of interfaces used in field types?
Example:
class ServiceImpl {
@Inject private OtherService otherService;
}
interface OtherService {}
class OtherServiceImpl implements OtherService {
}
So when testing ServiceImpl I expect OtherServiceImpl to be injected in ServiceImpl.otherService.
Sould this be enabled via annotation, or can this be the new default?
Did anybody else have this issue?
The text was updated successfully, but these errors were encountered:
When using cdi-unit the implementation classes are not discovered by default.
In our code base we have a guide line to use interfaces for all service classes.
All fields use the interface type.
This means, we need to manually add all required classes via annotations.
That is cumbersome and not useful.
Can we have a new feature, that cdi-unit finds and injects the implementations of interfaces used in field types?
Example:
So when testing
ServiceImpl
I expectOtherServiceImpl
to be injected inServiceImpl.otherService
.Sould this be enabled via annotation, or can this be the new default?
Did anybody else have this issue?
The text was updated successfully, but these errors were encountered: