Skip to content
Advertisement

Testing Private method using mockito

JavaScript

How to test private method is called or not, and how to test private method using mockito?

Advertisement

Answer

You can’t do that with Mockito but you can use Powermock to extend Mockito and mock private methods. Powermock supports Mockito. Here‘s an example.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement