I am hoping to use this rule to avoid hardcode in production projects. Recently, the rule in question did not warn, but the code had a URL encoded.
I tried with sonarqube version 5.6 and also with a local test using the docker image in version 7.6
Code that I am trying to trigger rule.
@SuppressWarnings ("rawtypes")
protected <T> ResponseEntity postForEntity(URI uri, Object body, Class<T> responseType) {
try {
ResponseEntity<T> response = restTemplate.postForEntity("http://something:8010/operation/test", body, responseType);
return response;
} catch (HttpClientErrorException | HttpServerErrorException e) {
logger.error(e);
return processErrorResponse(e.getResponseBodyAsString(), e.getStatusCode());
} catch (RestClientException e) {
logger.error(e);
}
return null;
}