import org.onap.vfc.nfvo.driver.vnfm.svnfm.aai.bo.entity.EsrSystemInfo;
 
 import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
 
 public class AaiVnfmInfo {
+       @SerializedName("vnfm-id")
        @JsonProperty("vnfm-id")
        private String vnfmId;
        
+       @SerializedName("vim-id")
        @JsonProperty("vim-id")
        private String vimId;
        
+       @SerializedName("certificate-url")
        @JsonProperty("certificate-url")
        private String certificateUrl;
        
+       @SerializedName("resource-version")
        @JsonProperty("resource-version")
        private String resourceVersion;
        
+       @SerializedName("esr-system-info-list")
        @JsonProperty("esr-system-info-list")
        private List<EsrSystemInfo> esrSystemInfoList;
 
 
 
 package org.onap.vfc.nfvo.driver.vnfm.svnfm.aai.bo.entity;
 
-import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.gson.annotations.SerializedName;
 
 public class EsrSystemInfo {
-       @JsonProperty("esr-system-info-id")
+       @SerializedName("esr-system-info-id")
        private String esrSystemId;
        
-       @JsonProperty("system-name")
+       @SerializedName("system-name")
        private String esrSystemName;
        
-       @JsonProperty("type")
+       @SerializedName("type")
        private String type;
        
-       @JsonProperty("vendor")
+       @SerializedName("vendor")
        private String vendor;
        
-       @JsonProperty("version")
+       @SerializedName("version")
        private String version;
        
-       @JsonProperty("service-url")
+       @SerializedName("service-url")
        private String serviceUrl;
        
-       @JsonProperty("user-name")
+       @SerializedName("user-name")
        private String userName;
        
-       @JsonProperty("password")
+       @SerializedName("password")
        private String password;
        
-       @JsonProperty("protocal")
+       @SerializedName("protocal")
        private String protocal;
        
-       @JsonProperty("ssl-cacert")
+       @SerializedName("ssl-cacert")
        private String sslCacert;
        
-       @JsonProperty("ssl-insecure")
+       @SerializedName("ssl-insecure")
        private String sslInsecure;
        
-       @JsonProperty("ip-address")
+       @SerializedName("ip-address")
        private String ip;
        
-       @JsonProperty("port")
+       @SerializedName("port")
        private String port;
        
-       @JsonProperty("cloud-domain")
+       @SerializedName("cloud-domain")
        private String cloudDomain;
        
-       @JsonProperty("default-tenant")
+       @SerializedName("default-tenant")
        private String defaultTenant;
 
        public String getEsrSystemId() {
 
 import java.util.HashMap;
 
 import org.apache.http.client.ClientProtocolException;
-import org.apache.http.impl.client.HttpClientBuilder;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.aai.bo.AaiVnfmInfo;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.aai.inf.AaiMgmrInf;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.common.bo.AdaptorEnv;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.constant.CommonConstants;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpClientProcessorInf;
-import org.onap.vfc.nfvo.driver.vnfm.svnfm.http.client.HttpRequestProcessor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
        private String operateHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws ClientProtocolException, IOException {
                String url=adaptorEnv.getAaiApiUriFront() + httpPath;
                
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
                
                String responseStr = httpClientProcessor.process(url, method, map, gson.toJson(httpBodyObj)).getContent();
 
        }
 
        public QueryVnfResponse queryRspConvert(CBAMQueryVnfResponse cbamResponse) {
-               QueryVnfResponse response = new QueryVnfResponse();
-               VnfInfo vnf = new VnfInfo();
+               QueryVnfResponse vnf = new QueryVnfResponse();
                vnf.setVnfdId(cbamResponse.getVnfdId());
                vnf.setVersion(cbamResponse.getVnfdVersion());
                vnf.setVnfInstanceId(cbamResponse.getId());
                vnf.setVnfProvider(cbamResponse.getVnfProvider());
                vnf.setVnfStatus(cbamResponse.getInstantiationState());
                vnf.setVnfType(cbamResponse.getVnfSoftwareVersion());
-               return response;
+               return vnf;
        }
 
        public OperStatusVnfResponse operRspConvert(OperationExecution oper) {
 
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.NslcmGrantVnfResponse;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.GrantInfo;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VimComputeResourceFlavour;
-
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.HealVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.ScaleVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest;
-
 import org.springframework.stereotype.Component;
 
 @Component
 
 import java.util.List;
 
 import org.apache.http.client.ClientProtocolException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.catalog.inf.CatalogMgmrInf;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMInstantiateVnfResponse;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.VnfPackageInfo;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.InstantiateVnfRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 public class InstantiateVnfContinueRunnable implements Runnable {
 
 import java.util.List;
 
 import org.apache.http.client.ClientProtocolException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfRequest;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.bo.CBAMTerminateVnfResponse;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.cbam.inf.CbamMgmrInf;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.bo.entity.ResourceDefinition;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.nslcm.inf.NslcmMgmrInf;
 import org.onap.vfc.nfvo.driver.vnfm.svnfm.vnfmdriver.bo.TerminateVnfRequest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 
 
                        vnfContinueProcessorInf.continueInstantiateVnf(driverRequest, vnfInstanceId, jobId.toString(), nslcmMgmr, catalogMgmr, cbamMgmr, requestConverter, jobDbManager);
                        
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> instantiateVnf. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
                        vnfContinueProcessorInf.continueTerminateVnf(driverRequest, vnfInstanceId, jobId, nslcmMgmr, cbamMgmr, requestConverter, jobDbManager);
                        
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> terminateVnf. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
                        CBAMQueryVnfResponse cbamResponse = cbamMgmr.queryVnf(vnfInstanceId);
                        driverResponse = responseConverter.queryRspConvert(cbamResponse);
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> queryVnf. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
                        String execId = jobInfo.getVnfmExecutionId();
                        cbamResponse = cbamMgmr.queryOperExecution(execId);
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> getOperStatus. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
                        CBAMScaleVnfResponse cbamResponse = cbamMgmr.scaleVnf(cbamRequest, vnfInstanceId);
                        driverResponse = responseConverter.scaleRspConvert(cbamResponse);
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> scaleVnf. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
                        CBAMHealVnfResponse cbamResponse = cbamMgmr.healVnf(cbamRequest, vnfInstanceId);
                        driverResponse = responseConverter.healRspConvert(cbamResponse);
                } catch (Exception e) {
+                       logger.error("error VnfmDriverMgmrImpl --> healVnf. ", e);
                        throw new VnfmDriverException(HttpStatus.SC_INTERNAL_SERVER_ERROR, CommonConstants.HTTP_ERROR_DESC_500);
                }
                
 
        public VnfPackageInfo queryVnfPackage(String vnfPackageId) throws ClientProtocolException, IOException {
                
                String url=adaptorEnv.getCatalogApiUriFront() + String.format(CommonConstants.RetrieveVnfPackagePath, vnfPackageId);
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                
                String bodyPostStr = String.format(CommonConstants.RetrieveCbamTokenPostStr, adaptorEnv.getGrantType(), adaptorEnv.getClientId(), adaptorEnv.getClientSecret());
                
 
        private String retrieveToken() throws ClientProtocolException, IOException, JSONException {
                String result = null;
                String url= adaptorEnv.getCbamApiUriFront() + CommonConstants.RetrieveCbamTokenPath;
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                map.put(CommonConstants.ACCEPT, "*/*");
                map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED_VALUE);
                
        
                String url= adaptorEnv.getCbamApiUriFront() + httpPath;
                
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                map.put(CommonConstants.AUTHORIZATION, "bearer " + token);
                map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
                
 
        
    public String getServiceUrlInMsbBySeriveNameAndPort(String serviceName, String version) throws RouteException
    {
+          String serviceUrl = null;
           MSBServiceClient msbClient = new MSBServiceClient(adaptorEnv.getMsbIp(), adaptorEnv.getMsbPort());
           MicroServiceFullInfo microServiceInfo = msbClient.queryMicroServiceInfo(serviceName, version);
           if(null == microServiceInfo)
           {
                   logger.error("There is no service in MSB for serviceName = {} and version = {}", serviceName, version);
           }
-          
-          String serviceUrl = microServiceInfo.getUrl();
-               logger.info("Service Url in MSB for serviceName = {} and version = {} is {}", serviceName, version, serviceUrl);
-               
-               return serviceUrl;
+          else
+          {
+                  serviceUrl = microServiceInfo.getUrl();
+                  logger.info("Service Url in MSB for serviceName = {} and version = {} is {}", serviceName, version, serviceUrl);
+          }
+          return serviceUrl;
                
    }
 
 
        private String operateNslcmHttpTask(Object httpBodyObj, String httpPath, RequestMethod method) throws ClientProtocolException, IOException {
                String url=adaptorEnv.getLcmApiUriFront() + httpPath;
                
-               HashMap<String, String> map = new HashMap<String, String>();
+               HashMap<String, String> map = new HashMap<>();
                map.put(CommonConstants.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
                
                String responseStr = httpClientProcessor.process(url, method, map, gson.toJson(httpBodyObj)).getContent();
 
 import java.util.HashMap;
 
 import org.apache.http.client.ClientProtocolException;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.InjectMocks;
                
                String json = "{"
                                + "\"vnfm-id\":\"vnfm-id_001\","
-                               + "\"esr-system-info-list\":[{\"ip\" : \"1.3.5.6\"}]"
+                               + "\"esr-system-info-list\":[{\"ip-address\" : \"1.3.5.6\"}]"
                                + "}"
                                + "";
                HttpResult httpResult = new HttpResult();
        public void testQueryVnfPackage() throws ClientProtocolException, IOException
        {
                AaiVnfmInfo vnfmInfo = aaiMgmr.queryVnfm(vnfmId);
-//             Assert.assertEquals("1.3.5.6", vnfmInfo.getEsrSystemInfoList().get(0).getIp());
+               Assert.assertEquals("1.3.5.6", vnfmInfo.getEsrSystemInfoList().get(0).getIp());
        }
 }
 
        public void testQueryVnf() throws ClientProtocolException, IOException {
                CBAMQueryVnfResponse mockCbamResponse = new CBAMQueryVnfResponse();
                mockCbamResponse.setId("executionId_001");
-               
+               mockCbamResponse.setVnfdId(vnfInstanceId);
                when(cbamMgmr.queryVnf(Mockito.anyString())).thenReturn(mockCbamResponse);
-               ScaleVnfRequest request = new ScaleVnfRequest();
-               request.setType(CommonEnum.ScaleType.SCALE_IN);
                QueryVnfResponse response = vnfmDriverMgmr.queryVnf(vnfmId, vnfInstanceId);
+               Assert.assertEquals(vnfInstanceId, response.getVnfdId());
        }
        
        @Test
                cbamResponse.setGrantId("001002001");
                
                when(cbamMgmr.queryOperExecution(Mockito.anyString())).thenReturn(cbamResponse);
-               ScaleVnfRequest request = new ScaleVnfRequest();
                OperStatusVnfResponse response = vnfmDriverMgmr.getOperStatus(vnfmId, "1");
+               
+               Assert.assertEquals("executionId_001", response.getJobId());
        }
 
 }
 
 import java.util.HashMap;
 
 import org.apache.http.client.ClientProtocolException;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.InjectMocks;
                when(httpClientProcessor.process(Mockito.anyString(), Mockito.any(RequestMethod.class), Mockito.any(HashMap.class), Mockito.anyString())).thenReturn(httpResult);
        }
 
+       
        @Test
        public void testQueryVnfPackage() throws ClientProtocolException, IOException
        {
-               VnfPackageInfo response = catalogMgmr.queryVnfPackage(vnfPackageId);
+               VnfPackageInfo packageInfo = catalogMgmr.queryVnfPackage(vnfPackageId);
+               Assert.assertEquals("1.3.5.6", packageInfo.getDownloadUri());
        }
 
 }