How to mock a final class with mockito

后端 未结 25 1403
日久生厌
日久生厌 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

    I had the same problem. Since the class I was trying to mock was a simple class, I simply created an instance of it and returned that.

提交回复
热议问题