Leaving @tested fields null for test setup methods can confuse users, as they expect them to be initialized together with mock fields. On the other hand, doing so would prevent the pre-recording of expectations that may be needed by the constructor of the tested class, or by a @PostConstruct/init method. It would also create ambiguities for test methods having @Injectable parameters.
The only reasonable choice I see is to add an optional boolean attribute to @tested, to let the user request that such objects be initialized before any test setup method.
Leaving @tested fields null for test setup methods can confuse users, as they expect them to be initialized together with mock fields. On the other hand, doing so would prevent the pre-recording of expectations that may be needed by the constructor of the tested class, or by a @PostConstruct/init method. It would also create ambiguities for test methods having @Injectable parameters.
The only reasonable choice I see is to add an optional boolean attribute to @tested, to let the user request that such objects be initialized before any test setup method.