aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
diff options
context:
space:
mode:
authorWojciech Sliwka <wojciech.sliwka@nokia.com>2019-04-09 14:10:15 +0200
committerWojciech Sliwka <wojciech.sliwka@nokia.com>2019-04-10 13:28:26 +0200
commit9ae2e4cae267c992f5017d91b1e28ee5551f3049 (patch)
treedc8bfa7df83acc5e733d07722c6c3ba93349557b /vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
parent2e77a83940fbe63305045ae8712404e38e8be185 (diff)
Inject an SystemPropertiesWrapper instance to MsoClient
Change-Id: Ibbc8540042fc46bd0df42efec99cff5fc2e371a3 Issue-ID: VID-404 Signed-off-by: Wojciech Sliwka <wojciech.sliwka@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index 0c05b80e2..6a498fc01 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -50,6 +50,7 @@ import org.onap.vid.mso.MsoUtil;
import org.onap.vid.mso.RestMsoImplementation;
import org.onap.vid.mso.RestObject;
import org.onap.vid.utils.Logging;
+import org.onap.vid.utils.SystemPropertiesWrapper;
/**
@@ -71,8 +72,8 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
*/
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
- public MsoRestClientNew(SyncRestClient client, String baseUrl, HttpsAuthClient authClient) {
- super(authClient);
+ public MsoRestClientNew(SyncRestClient client, String baseUrl, HttpsAuthClient authClient, SystemPropertiesWrapper systemPropertiesWrapper) {
+ super(authClient,systemPropertiesWrapper);
this.client = client;
this.baseUrl = baseUrl;
this.commonHeaders = initCommonHeaders();
@@ -525,8 +526,8 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
private Map<String, String> initCommonHeaders() {
- String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
- String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
+ String username = systemProperties.getProperty(MsoProperties.MSO_USER_NAME);
+ String password = systemProperties.getProperty(MsoProperties.MSO_PASSWORD);
String decrypted_password = Password.deobfuscate(password);
String authString = username + ":" + decrypted_password;
@@ -538,7 +539,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
map.put(HttpHeaders.AUTHORIZATION, "Basic " + authStringEnc);
map.put(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON);
map.put(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- map.put(X_FROM_APP_ID, SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME));
+ map.put(X_FROM_APP_ID, systemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME));
map.put(SystemProperties.ECOMP_REQUEST_ID, Logging.extractOrGenerateRequestId());
return ImmutableMap.copyOf(map);
}