New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create @Tested objects before test setup (@Before, @BeforeMethod) methods #122

Closed
rliesenfeld opened this Issue Jan 9, 2015 · 0 comments

Comments

1 participant
@rliesenfeld
Member

rliesenfeld commented Jan 9, 2015

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.

@rliesenfeld rliesenfeld self-assigned this Jan 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment