Add unit test for vim register info.
[aai/esr-server.git] / esr-mgr / src / main / java / org / onap / aai / esr / util / VimManagerUtil.java
index de10ac1..06a8ef0 100644 (file)
@@ -18,7 +18,6 @@ package org.onap.aai.esr.util;
 
 import java.util.ArrayList;
 
-import org.onap.aai.esr.common.SystemStatus;
 import org.onap.aai.esr.common.SystemType;
 import org.onap.aai.esr.entity.aai.EsrSystemInfo;
 import org.onap.aai.esr.entity.aai.CloudRegionDetail;
@@ -44,6 +43,7 @@ public class VimManagerUtil {
     cloudRegion.setCloudExtraInfo(vimRegisterInfo.getCloudExtraInfo());
     
     esrSystemInfoObj = vimAuthInfo2EsrSystemInfoObj(vimRegisterInfo.getVimAuthInfos());
+    esrSystemInfoObj.setSystemStatus(vimRegisterInfo.getStatus());
     esrSystemInfoList = ExtsysUtil.getEsrSystemInfoListFromAuthInfo(esrSystemInfoObj);
     cloudRegion.setEsrSystemInfoList(esrSystemInfoList);
     return cloudRegion;
@@ -61,7 +61,7 @@ public class VimManagerUtil {
     esrSystemInfoObj.setSslInsecure(vimAuthInfo.getSslInsecure());
     esrSystemInfoObj.setEsrSystemInfoId(ExtsysUtil.generateId());
     esrSystemInfoObj.setSystemType(SystemType.VIM.toString());
-    esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
+//    esrSystemInfoObj.setSystemStatus(SystemStatus.normal.toString());
     return esrSystemInfoObj;
   }
   
@@ -91,6 +91,7 @@ public class VimManagerUtil {
     vimRegisterInfo.setComplexName(cloudRegion.getComplexName());
     vimRegisterInfo.setCloudRegionVersion(cloudRegion.getCloudRegionVersion());
     vimRegisterInfo.setOwnerDefinedType(cloudRegion.getOwnerDefinedType());
+    vimRegisterInfo.setStatus(cloudRegion.getEsrSystemInfoList().getEsrSystemInfo().get(0).getSystemStatus());
     return vimRegisterInfo;
   }
 }