简体   繁体   English

jmock创建模拟对象遇到lawnargumentException

[英]jmock create mock object encounter illegalargumentException

When I was using jmock, somehow it fails at this line 当我使用jmock时,在这一行它以某种方式失败

Mock mockObject = mock(Classname.class, new Class[] { Position.class, Position.class, List.class,
            List.class, String.class, int.class}, new Object[] { null, null, null, null, null, null });

I'm using jmock1, I'm pretty sure the ctor is correct. 我正在使用jmock1,我很确定ctor是正确的。

Why you are doing mocking like this in JMockit?? 为什么在JMockit中像这样进行嘲笑?

I don't see familiar syntax as JMOckit. 我没有看到像JMOckit那样熟悉的语法。 The above code which you paste is not clear enough to understand.Is this the parameterized private method which you are trying to mock? 您粘贴的上面的代码尚不清楚,这是您要模拟的参数化私有方法吗?

Getting started with JMockit: Standard Document Simple link with example quick to refer JMockit入门:标准文档 简单链接和示例快速参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM