restTemplate.getForObject (String url, Class responseType, Object ... uriVariables) должен иметь дело с переменными uri, такими как {myVar} в вашем String url.
Если вы хотите установить параметры запроса, рассмотритеиспользуя UriComponentsBuilder.
URI uri = UriComponentsBuilder.fromHttpUrl("http://localhost:8064/spacestudy/" +instituteIdentifier +"/communication/alertmanagement/getDepartmentInstitute")
.queryParam("nUserId", nUserId)
.queryParam("nDeptInst", nInstId)
.build().toUri();
Integer nInstTo = restTemplate.getForObject(uri,Integer.class);
Или вы можете установить их вручную следующим образом:
String uri = "http://localhost:8064/spacestudy/" +instituteIdentifier +"/communication/alertmanagement/getDepartmentInstitute"
+ "?nUserId=" + nUserId + "&nDeptInst=" + nInstId;
Я предпочитаю решение UriComponentsBuilder.