How to mock super class method using Mockito or anyother relavent java framework

后端 未结 3 1625
暖寄归人
暖寄归人 2021-01-05 00:54

My Scenario is as below

class SuperClass{
   public void run(){
      System.out.println(\"I am running in Super class\");
   }
}

class ChildClass extends S         


        
3条回答
  •  独厮守ぢ
    2021-01-05 01:17

    As a quick way around, I just added a different proxy method on the subclass that calls super's run. Then you can mock the "proxy".

提交回复
热议问题