我正在尝试在下面粘贴的callRestService函数中使用Powermockito。在正确的方法上做任何可能的指示?
public RestResponse callRestService(RestRequest request) {
HttpHeaders headers = new HttpHeaders();
headers.setAccept(Arrays.asList(new MediaType[] { MediaType.APPLICATION_JSON }));
headers.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<RestRequest> entityReq = new HttpEntity<RestRequest>(
request, headers);
RestTemplate template = new RestTemplate();
ResponseEntity<RestResponse> respEntity = template.
exchange("RestSvcUrl", HttpMethod.POST, entityReq, RestResponse.class);
return respEntity.getBody();
}