if(userCredentials == null) {
client = SonarClient.create(serverUrl);
}else{
client=SonarClient.builder().url(serverUrl).login(userCredentials.getUsername()).password(PassEncoder.decodeAsString(userCredentials.getPassword())).build();
}
return client.actionPlanClient().find(resource);
}catch(HttpException ex) {
if(ex.status() == UNAUTHORIZED_RESPONSE_STATUS){
throw new AuthorizationException(ex);
}else{
throw ex;