RestTemplateController extends BaseController { @RequestMapping("{sign}/{id}") public String restTemplateClient(@PathVariable("sign") String sign,@PathVariable("id") String id) { return sign+id; }  @RequestMapping("{sign}/{id}") String restTemplateClient(@PathVariable("sign") String sign,@PathVariable("id") String id); @RequestMapping("/exception/{type}") String testException(@PathVariable("type")int type);  }
@Test public void testRestTemplateClient() throws Exception { String[] uriVariables={"aaaa签名","001"}; ResponseEntity<String> exchange = restTemplate.exchange(TEST_URL_ONE, HttpMethod.POST, null, String.class,uriVariables); log.info(exchange.getBody()); assertEquals(exchange.getStatusCode(), HttpStatus.OK); }