What do I use instead of Whitebox in Mockito 2.2 to set fields?

后端 未结 5 1958
Happy的楠姐
Happy的楠姐 2020-12-16 10:22

When using Mockito 1.9.x I have been using Whiteboxto set values of fields to \"inject\" mocks. Se example below:

@Before
public void setUp() {
         


        
5条回答
  •  清歌不尽
    2020-12-16 10:57

    Here with fest-reflect api you can find an easy to use fluent API for reflection support. This is what I use as an alternative to Mockito's Whiltebox.

提交回复
热议问题