Mocking private method of class under test using JMockit

后端 未结 3 1025
醉话见心
醉话见心 2020-12-15 23:17

I want to mock private method of a class under test but method return false first two times when the method is called after that it should return false. Here is the code wha

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-16 00:13

    This works for me:-

            new MockUp() {
                @Mock
                boolean methodToMock(int value) {
                    return true;
                }
            };
    

提交回复
热议问题