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;
@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
*/
@Test
public void testUnableToQueryVim() throws Exception {
- ApiException expectedException = new ApiException();
+ RuntimeException expectedException = new RuntimeException();
when(nsLcmApi.queryVIMInfo(VIM_ID)).thenThrow(expectedException);
//when
try {
@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
*/
@Test
public void testUnableToQueryVnfm() throws Exception {
- ApiException expectedException = new ApiException();
+ RuntimeException expectedException = new RuntimeException();
when(nsLcmApi.queryVnfmInfo(VNFM_ID)).thenThrow(expectedException);
//when
try {