【发布时间】:2019-06-22 05:37:36
【问题描述】:
我正在尝试模拟 restTeamplate.exchange 方法,但在尝试模拟时出现以下错误 RestTemplate 类型中的方法 exchange(String, HttpMethod, HttpEntity, Class, Object...) 不适用于参数(String, HttpMethod, HttpEntity, Object)
Mockito.when(restTemplate.exchange(
Matchers.anyString(),
Matchers.any(HttpMethod.class),
Matchers.<HttpEntity<?>> any(),
Matchers.<Object> any())
).thenReturn(myResponse);
【问题讨论】: