aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/test/java/org/onap/vid/mso/rest
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/test/java/org/onap/vid/mso/rest
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/test/java/org/onap/vid/mso/rest')
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java5
-rw-r--r--vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java9
2 files changed, 10 insertions, 4 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
index 12fd4a519..832aa098a 100644
--- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientNewTest.java
@@ -45,6 +45,7 @@ import org.onap.vid.mso.MsoProperties;
import org.onap.vid.mso.MsoResponseWrapper;
import org.onap.vid.mso.MsoResponseWrapperInterface;
import org.onap.vid.mso.RestObject;
+import org.onap.vid.utils.SystemPropertiesWrapper;
import org.springframework.test.context.ContextConfiguration;
@ContextConfiguration(classes = {SystemProperties.class})
@@ -473,10 +474,10 @@ public class MsoRestClientNewTest {
private MsoRestClientNew msoRestClient() {
final WebConfig webConfig = new WebConfig();
- return new MsoRestClientNew(new SyncRestClient(webConfig.unirestFasterxmlObjectMapper(new ObjectMapper())), baseUrl(),null);
+ return new MsoRestClientNew(new SyncRestClient(webConfig.unirestFasterxmlObjectMapper(new ObjectMapper())), baseUrl(), null, new SystemPropertiesWrapper());
}
private MsoRestClientNew createTestSubject() {
- return new MsoRestClientNew(null, "",null);
+ return new MsoRestClientNew(null, "", null, new SystemPropertiesWrapper());
}
}
diff --git a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
index 839e6e6c1..050fa0dce 100644
--- a/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
+++ b/vid-app-common/src/test/java/org/onap/vid/mso/rest/MsoRestClientTest.java
@@ -44,12 +44,14 @@ import org.onap.vid.changeManagement.WorkflowRequestDetail;
import org.onap.vid.client.SyncRestClient;
import org.onap.vid.controller.LocalWebConfig;
import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.MsoProperties;
import org.onap.vid.mso.MsoResponseWrapper;
import org.onap.vid.mso.MsoResponseWrapperInterface;
import org.onap.vid.mso.MsoUtil;
import org.onap.vid.mso.RestObject;
import org.onap.vid.mso.model.CloudConfiguration;
import org.onap.vid.mso.model.RequestReferences;
+import org.onap.vid.utils.SystemPropertiesWrapper;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.web.WebAppConfiguration;
import org.testng.annotations.BeforeClass;
@@ -75,6 +77,8 @@ public class MsoRestClientTest {
@Mock
private SyncRestClient client;
+ @Mock
+ private SystemPropertiesWrapper systemProperties;
private MsoRestClientNew restClient;
@@ -82,8 +86,9 @@ public class MsoRestClientTest {
@BeforeClass
private void setUp(){
initMocks(this);
- restClient = new MsoRestClientNew(client,baseUrl,null);
-
+ when(systemProperties.getProperty(MsoProperties.MSO_PASSWORD)).thenReturn("OBF:1ghz1kfx1j1w1m7w1i271e8q1eas1hzj1m4i1iyy1kch1gdz");
+ when(systemProperties.getProperty("app_display_name")).thenReturn("vid");
+ restClient = new MsoRestClientNew(client,baseUrl,null,systemProperties);
}
@Test