How mock private method that modify private variables?

后端 未结 3 1477
醉梦人生
醉梦人生 2021-01-13 14:07

How mock private method that modify private variables?

class SomeClass{
    private int one;
    private int second;

    public SomeClass(){}

    public in         


        
3条回答
  •  耶瑟儿~
    2021-01-13 14:34

    Power mock might help you here. But generally I would make the method protected and override the previously-private method to do what ever I wanted it to do.

提交回复
热议问题