How to mock a final class with mockito

后端 未结 25 1397
日久生厌
日久生厌 2020-11-22 16:35

I have a final class, something like this:

public final class RainOnTrees{

   public void startRain(){

        // some code here
   }
}

I

25条回答
  •  一整个雨季
    2020-11-22 16:39

    Use Powermock. This link shows, how to do it: https://github.com/jayway/powermock/wiki/MockFinal

提交回复
热议问题