Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Create @Tested objects before test setup (@Before, @BeforeMethod) methods #122
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.