- return UriComponentsBuilder.fromUriString(policiesUrl(nearRtRicUrl))
- .pathSegment(policyId + "?policyTypeId=" + policyTypeId).build().toString();
+ UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(policiesUrl(nearRtRicUrl)).pathSegment(policyId);
+
+ if (!policyTypeId.isEmpty()) {
+ builder.queryParam("policyTypeId", policyTypeId);
+ }
+ return builder.build().toString();