You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description of the problem or enhancement request:
I've seen that if one uses a @nested class containing fields annotated with @mocked, those are not initialized (resulting in NPEs).
An obvious workaround is to move those fields to the outer class, but this somewhat goes against the spirit of nested classes, which allow to encapsulate related groups of tests. If the mocked fields are only relevant to the nested class, why should they be defined outside?
I've seen this was already reported in #458, but it was closed by simply saying "only fields in outer classes are supported by @mock". Can this be reconsidered?
Version of JMockit that was used: 1.41
Description of the problem or enhancement request:
I've seen that if one uses a @nested class containing fields annotated with @mocked, those are not initialized (resulting in NPEs).
An obvious workaround is to move those fields to the outer class, but this somewhat goes against the spirit of nested classes, which allow to encapsulate related groups of tests. If the mocked fields are only relevant to the nested class, why should they be defined outside?
I've seen this was already reported in #458, but it was closed by simply saying "only fields in outer classes are supported by @mock". Can this be reconsidered?
Here's a sample code demonstrating the issue:
Thanks!
The text was updated successfully, but these errors were encountered: