-
-
Notifications
You must be signed in to change notification settings - Fork 315
Closed
Description
Currently, if I'm using EasyMockRunner
/ EasyMockRule
and the @Mock
annotation, I have the choice of using @Mock(name = "xxx")
or else having an unnamed mock.
This works, but it means that if I'm mocking two different fields with the same type then I have to explicitly give them names or else the logs get confusing.
It would be relatively easy for this to instead use the field name as the default name for the mock, so that the only time you need to specify the name="xxx"
is if you actually want a different value - which is probably rare.
Effectively it means that:
@Mock(name = "mockService")
private Service mockService;
just becomes:
@Mock
private Service mockService;
but still does the exact same thing.