I can see that dependency injection is added when the class under test is annotated according to JEE semantics, or when an annotated class is being constructed in the test code. However it seems that dependency injection will not occur for annotated code that is not directly called by the test code (but rather called implicitly by methods that appear the test code). That is, if a method m of class A calls a method n of annotated class B, and only the call to m appears in the test, the annotations of B will not be handled, resulting in null pointer exceptions. Is this indeed the case? If so, are there ways to overcome this problem besides targeting all classes?
A general question about EvoSuite JEE support.
I can see that dependency injection is added when the class under test is annotated according to JEE semantics, or when an annotated class is being constructed in the test code. However it seems that dependency injection will not occur for annotated code that is not directly called by the test code (but rather called implicitly by methods that appear the test code). That is, if a method m of class A calls a method n of annotated class B, and only the call to m appears in the test, the annotations of B will not be handled, resulting in null pointer exceptions. Is this indeed the case? If so, are there ways to overcome this problem besides targeting all classes?