org.mockito.exceptions.base.MockitoException: Unable to initialize @Spy annotated field 'a'. null


Solutions on the web

Solution icon of github
Unable to initialize @Spy annotated field 'a'. null

Stack trace

org.mockito.exceptions.base.MockitoException: Unable to initialize @Spy annotated field 'a'.
null
	at org.mockito.internal.configuration.SpyAnnotationEngine.process(SpyAnnotationEngine.java:70)
	at org.mockito.internal.configuration.InjectingAnnotationEngine.processIndependentAnnotations(InjectingAnnotationEngine.java:59)
	at org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAnnotationEngine.java:41)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.