Mockito匹配InvalidUseOfMatchersException返回null

时间:2013-12-26 15:00:30

标签: junit mocking mockito

我需要从:

返回null
Cookie controlCookieValue = getCookie(cookiesConfigBean.getControlCookieName());

我在做:

when(baseHandler.getCookie(any(String.class))).thenReturn(null);

但代码抛出InvalidUseOfMatchersException。我尝试使用anyObject()anyString(),但没有任何效果。 baseHandler对象是模拟的。

0 个答案:

没有答案
相关问题