-
Notifications
You must be signed in to change notification settings - Fork 238
Mixing Java and Spring annotations. #103
Copy link
Copy link
Closed
Labels
Description
Whenever one mix Java and Spring annotations:
- org.springframework.beans.factory.annotation.Autowired
- javax.annotation.Resource
and create a test:
public class MyTest {
@Tested
private TestedClass testedClass;
@Injectable
@Mocked
private SomeService annotatedWithAutowired
@Injectable
@Mocked
private SomeService annotatedWithResource
}
class TestedClass {
@Autowired
private SomeService1 annotatedWithAutowired;
@Resource
private SomeService2 annotatedWithResource;
}
only fields with Java annotations are injected to @tested object.
What I think need to be fixed/redesign is a discardFieldsNotAnnotatedWithJavaxInjectIfAtLeastOneIsAnnotated method inside
mockit.internal.expectations.injection.FieldInjection class
Reactions are currently unavailable