method.invoke()的Mockito测试用例

时间:2015-09-14 14:51:43

标签: java junit mockito

我应该如何为这个Java代码编写Mockito JUnit测试用例?

Method[] methods = Sample.class.getMethods();
for (Method method : methods) {
    method.invoke(null)
}

2 个答案:

答案 0 :(得分:0)

答案 1 :(得分:0)

You can try writing mockito junit for this method itself, rather api specific junits

Refer: Testing - how to create Mock object