From 9ae2e4cae267c992f5017d91b1e28ee5551f3049 Mon Sep 17 00:00:00 2001 From: Wojciech Sliwka Date: Tue, 9 Apr 2019 14:10:15 +0200 Subject: Inject an SystemPropertiesWrapper instance to MsoClient Change-Id: Ibbc8540042fc46bd0df42efec99cff5fc2e371a3 Issue-ID: VID-404 Signed-off-by: Wojciech Sliwka --- .../src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java') 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 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); } -- cgit 1.2.3-korg