Hi I have a following Qualifier Type defined..
@Qualifier
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.TYPE, ElementType.FIELD })
public @interface SortAndFilterType {
/**
* The value for the sort and filter.
*
* @return the sort and filter type value.
*/
String value();
}
And Two Implementations out of it.
@SortAndFilterType("Users")
public class UserSortAndFilterProviderImpl implements SortAndFilterProvider<Field, User> {}
@SortAndFilterType("ReportsList")
public class ReportListSortAndFilterProviderImpl implements SortAndFilterProvider<Field, ReportList> {}
And I'm injecting from the Client as ..
@Inject
@SortAndFilterType("Users")
private SortAndFilterProvider mSortAndFilterProvider;
Every thing works fine at run time..
But the Problem comes when I ran Unit tests..
I'm getting the below Exception..
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type SortAndFilterProvider with qualifiers @SortAndFilterType at injection point [BackedAnnotatedField] @Inject @SortAndFilterType private com.collabnet.ctf.saturn.client.apps.users.ChangeUsersStatus.mSortAndFilterProvider
I invoke this from unit tests like this..it runs with @RunWith(CdiRunner.class)
@Produces
@SortAndFilterType("Users")
@Mock
private SortAndFilterProvider mSortAndFilterProvider;
Whats going wrong here?