Fix some security vulnerabilities
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / test / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / onap / vfc / TestVfcExternalSystemInfoProvider.java
index 537093c..5f1ecc8 100644 (file)
@@ -19,10 +19,10 @@ package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.onap.vfc;
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.TestBase;
-import org.onap.vnfmdriver.ApiException;
 import org.onap.vnfmdriver.model.VimInfo;
 import org.onap.vnfmdriver.model.VnfmInfo;
 import org.springframework.test.util.ReflectionTestUtils;
+import retrofit2.Call;
 
 import static junit.framework.TestCase.assertEquals;
 import static junit.framework.TestCase.fail;
@@ -44,7 +44,8 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
     @Test
     public void testVimRetrieval() throws Exception {
         VimInfo expectedVimInfo = new VimInfo();
-        when(nsLcmApi.queryVIMInfo(VIM_ID)).thenReturn(expectedVimInfo);
+        Call<VimInfo> vimInfoCall = buildCall(expectedVimInfo);
+        when(nsLcmApi.queryVIMInfo(VIM_ID)).thenReturn(vimInfoCall);
         //when
         VimInfo vimInfo = vfcExternalSystemInfoProvider.getVimInfo(VIM_ID);
         //verify
@@ -56,7 +57,7 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
      */
     @Test
     public void testUnableToQueryVim() throws Exception {
-        ApiException expectedException = new ApiException();
+        RuntimeException expectedException = new RuntimeException();
         when(nsLcmApi.queryVIMInfo(VIM_ID)).thenThrow(expectedException);
         //when
         try {
@@ -74,7 +75,8 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
     @Test
     public void testVnfmRetrieval() throws Exception {
         VnfmInfo expectedVimInfo = new VnfmInfo();
-        when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenReturn(expectedVimInfo);
+        Call<VnfmInfo> vnfmInfoCall = buildCall(expectedVimInfo);
+        when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenReturn(vnfmInfoCall);
         //when
         VnfmInfo vimInfo = vfcExternalSystemInfoProvider.queryVnfmInfoFromSource(VNFM_ID);
         //verify
@@ -86,7 +88,7 @@ public class TestVfcExternalSystemInfoProvider extends TestBase {
      */
     @Test
     public void testUnableToQueryVnfm() throws Exception {
-        ApiException expectedException = new ApiException();
+        RuntimeException expectedException = new RuntimeException();
         when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenThrow(expectedException);
         //when
         try {