- String url = baseUrl() + "/policy?id={id}";
- Map<String, ?> uriVariables = Map.of("id", id);
-
- return this.restTemplate.getForEntity(url, Object.class, uriVariables);
+ try {
+ String url = "/policy?id=" + id;
+ ResponseEntity<String> rsp = webClient.getForEntity(url).block();
+ JsonObject obj = JsonParser.parseString(rsp.getBody()).getAsJsonObject();
+ String str = obj.toString();
+ return new ResponseEntity<>(str, rsp.getStatusCode());
+ } catch (Exception e) {
+ ResponseEntity<String> rsp = ErrorResponseHandler.handleException(e);
+ return new ResponseEntity<>(rsp.getBody(), rsp.getStatusCode());
+ }