Mocking member variables of a class using Mockito

前端 未结 9 1826
醉话见心
醉话见心 2020-12-07 10:24

I am a newbie to development and to unit tests in particular . I guess my requirement is pretty simple, but I am keen to know others thoughts on this.

Suppose I h

9条回答
  •  情话喂你
    2020-12-07 10:28

    If you want an alternative to ReflectionTestUtils from Spring in mockito, use

    Whitebox.setInternalState(first, "second", sec);
    

提交回复
热议问题