Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试使用 mockito 时出现以下错误
"the method when(t) in the type mockito is not applicable for the arguments (void)"
我的代码看起来像,
when(myFun(arg1, arg2)).thenReturn(fun());
myfun 不是void。myFun我在 SO 中发现了一些由于返回而发生相同错误的帖子void,但在我的情况下并非如此。还有其他原因导致这种情况发生吗?
void
myFun