Package org.mockito

Annotation Type MockitoAnnotations.Mock


  • @Target(FIELD)
    @Retention(RUNTIME)
    @Deprecated
    public static @interface MockitoAnnotations.Mock
    Deprecated.
    Use top-level Mock annotation instead

    When @Mock annotation was implemented as an inner class then users experienced problems with autocomplete features in IDEs. Hence @Mock was made a top-level class.

    How to fix deprecation warnings? Typically, you can just search: import org.mockito.MockitoAnnotations.Mock; and replace with: import org.mockito.Mock;

    If you're an existing user then sorry for making your code littered with deprecation warnings. This change was required to make Mockito better.