Skip navigation links
  • Overview
  • Package
  • Class
  • Use
  • Tree
  • Deprecated
  • Index
  • Help

Deprecated API

Contents

  • Terminally Deprecated
  • Methods
  • Annotation Type Elements
  • Terminally Deprecated Elements
    Element
    Description
    org.mockito.plugins.MockitoPlugins.getInlineMockMaker()
    Please use MockitoPlugins.getMockMaker(String) with MockMakers.INLINE instead.
  • Deprecated Methods
    Method
    Description
    org.mockito.Mock.lenient()
    Use Mock.strictness() instead. Mock will be lenient, see MockSettings.lenient(). For examples how to use 'Mock' annotation and parameters see Mock.
    org.mockito.mock.MockCreationSettings.isLenient()
    Use MockCreationSettings.getStrictness() instead. Informs if the mock was created with "lenient" strictness, e.g. having Strictness.LENIENT characteristic. For more information about using mocks with lenient strictness, see MockSettings.lenient().
    org.mockito.MockitoAnnotations.initMocks(Object)
    Use MockitoAnnotations.openMocks(Object) instead. This method is equivalent to openMocks(testClass).close(). The close method should however only be called after completed usage of testClass. If using static-mocks or custom MockMakers, using this method might cause misbehavior of mocks injected into the test class.
    org.mockito.MockSettings.lenient()
    Use MockSettings.strictness(Strictness) instead. Lenient mocks bypass "strict stubbing" validation (see Strictness.STRICT_STUBS). When mock is declared as lenient none of its stubbings will be checked for potential stubbing problems such as 'unnecessary stubbing' (UnnecessaryStubbingException) or for 'stubbing argument mismatch' PotentialStubbingProblem.
    
       Foo mock = mock(Foo.class, withSettings.lenient());
     
    For more information and an elaborate example, see Mockito.lenient().
    org.mockito.plugins.MockitoPlugins.getInlineMockMaker()
    Please use MockitoPlugins.getMockMaker(String) with MockMakers.INLINE instead.
  • Deprecated Annotation Type Elements
    Annotation Type Element
    Description
    org.mockito.Mock.lenient()
    Use Mock.strictness() instead. Mock will be lenient, see MockSettings.lenient(). For examples how to use 'Mock' annotation and parameters see Mock.