Mock final classes and methods

Other topics

How to make it

Steps:

  1. Add dependency to Mockito version 2.x in your gradle (at the time of writing this text the latest version is 2.7.22):

    testCompile "org.mockito:mockito-core:$versions.mockito"
    
  2. Create a file in test resources with name org.mockito.plugins.MockMaker: tree structure

  3. Add next line in this file:

    mock-maker-inline
    

Contributors

Topic Id: 9769

Example Ids: 30096

This site is not affiliated with any of the contributors.