public List<Test> getList(String userId) {
String url= "http://localhost:8000/getUsers?id={id}"; // url
Map<String, Object> param = new HashMap<>();
param.put("id", 1);
try {
return restTemplate.exchange(
url,
HttpMethod.GET,
null,
new ParameterizedTypeReference<List<Test>>() {
},
param
).getBody();
} catch (Exception e) {
return new ArrayList<>();
}
}