I tried to mock two objects of the same type with Mockito 1.9.5 using JUnit and it works.
See: http://static.javadoc.io/org.mockito/mockito-core/1.9.5/org/mockito/InjectMocks.html
Information about the corresponding type from the document:
"Entering fields, mocks will first be allowed by type, then if there are several properties of the same type, the field name and layout name match."
And this one that seems to make the false name match the field name for all your layouts when you have two of the same type:
"Note 1: If you have fields of the same type (or with the same erasure), it is better to name all @Mock annotated fields @Mock appropriate fields, otherwise Mockito may get confused and injection will not happen."
Perhaps this last one bites you?
splonk
source share