我是测试新手。我试过这个,但有一个例外。
@Mock
private Context context;
...
when(service.getResult(any(), context)).thenReturn(new ArrayList<>());
Run Code Online (Sandbox Code Playgroud)
例外:
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
参数匹配器的使用无效!
预计 2 个匹配者,1 个记录: