How to mock a final class with mockito

后端 未结 25 1509
日久生厌
日久生厌 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 17:00

    Didn't try final, but for private, using reflection remove the modifier worked ! have checked further, it doesn't work for final.

提交回复
热议问题