jmockit / jmockit1

Advanced Java library for integration testing, mocking, faking, and code coverage
Other
465 stars 240 forks source link

@Injectable cascade #79

Closed ColinHebert closed 10 years ago

ColinHebert commented 10 years ago

It seems that since 1.12 @Injectable cascades but doesn't provide a way to stop the cascading.

rliesenfeld commented 10 years ago

Yes, it now cascades. The way to disable cascading is explained in the release notes for version 1.12 (http://jmockit.github.io/changes.html), and also in the API documentation for and @Mocked (http://jmockit.github.io/api1x/mockit/Mocked.html) and @Cascading (http://jmockit.github.io/api1x/mockit/Cascading.html).

ColinHebert commented 10 years ago

Wut? @rliesenfeld It explains how to disable it for @Mocked, not for @Injectable (which is the reason why I opened this issue).

rliesenfeld commented 10 years ago

Well, the API documentation for @Injectable says that it creates a mocked (@Mocked) instance, so everything that applies to @Mocked applies to @Injectable, except of course for the aspects that are specific to @Injectable. I guess it can be made more clear in the API doc for @Injectable, but I don't want to repeat everything there, obviously.

ColinHebert commented 10 years ago

But there is no cascading option for @Injectable AFAICT.

https://jmockit.github.io/api1x/mockit/Injectable.html

rliesenfeld commented 10 years ago

Indeed, there isn't. I will review the API documentation for @Injectable to make it more complete and clear.

ColinHebert commented 10 years ago

So without the cascading option for @Injectable how do I disable cascading for @Injectable?