new Expectations() {{
someMethod.getLocalObj().getValue((SomeClass)any);
returns(1);
times=1;
request.doSomething().setTransaction((null)any); // HERE****how to match ??
times=0;
}};
嗨。我正在尝试匹配将变量设置为 null 的方法。我怎样才能在 JMockit 中做到这一点?
谢谢。
最佳答案
您正在此处寻找此方法:withNull() :
与 withEqual(Object) 相同,但检查重播阶段的调用参数是否为空。
关于java - JMockit 与 null 匹配,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38456779/