* ========================LICENSE_START=================================
* O-RAN-SC
* %%
- * Copyright (C) 2019 AT&T Intellectual Property
+ * Copyright (C) 2019 Nordix Foundation
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
public class PolicyAgentApiImpl implements PolicyAgentApi {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- RestTemplate restTemplate = new RestTemplate();
+ RestTemplate restTemplate;
private static com.google.gson.Gson gson = new GsonBuilder() //
.serializeNulls() //
@Autowired
public PolicyAgentApiImpl(
@org.springframework.beans.factory.annotation.Value("${policycontroller.url.prefix}") final String urlPrefix) {
+ this(urlPrefix, new RestTemplate());
logger.debug("ctor prefix '{}'", urlPrefix);
+ }
+
+ public PolicyAgentApiImpl(String urlPrefix, RestTemplate restTemplate) {
this.urlPrefix = urlPrefix;
+ this.restTemplate = restTemplate;
}
private String baseUrl() {