Improve SONAR coverage

Change-Id: I02e9535f96040cd038ef064ee5881c4c3e5e7bca
Issue-ID: VID-72
Signed-off-by: Ofir Sonsino <os0695@att.com>
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
index d73c75b..696e189 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
@@ -328,9 +328,14 @@
             JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
             if (jsonServiceObject.get("uuid").equals(serviceUuid.toString())) {
                 toscaModelURL = jsonServiceObject.getString("toscaModelURL");
+                break;
             }
         }
 
+        if (toscaModelURL==null){
+            return null;
+        }
+        
         final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
 
         ClassLoader classLoader = getClass().getClassLoader();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
index 123cc57..2b783d4 100755
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
@@ -114,7 +114,7 @@
 	 *

 	 * @param builder the builder

 	 */

-	private InMemoryAsdcClient(Builder builder) {

+	InMemoryAsdcClient(Builder builder) {

 		catalog = builder.catalog;

 		mapper = builder.mapper;

 	}

diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java b/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
index e2b32fa..f364d0b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
@@ -47,7 +47,7 @@
     public ServiceModel makeServiceModel(Path path, Service asdcServiceMetadata) throws Exception {
         ServiceModel serviceModel = new ServiceModel();
         SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
-        ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath());
+        ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath()); //, false);
         serviceModel.setService(extractServiceFromCsar(asdcServiceMetadata, sdcCsarHelper));
         serviceModel.setVolumeGroups(extractVolumeGroups(sdcCsarHelper));
         serviceModel.setVfModules(extractVfModuleFromCsar(sdcCsarHelper));
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
index 8742931..e879fd4 100755
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
+++ b/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
@@ -171,8 +171,8 @@
 		service.setInputs(serviceToscaModel.gettopology_template().getInputs());

 		//FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702

 		//THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME

-		//service.setVersion(serviceToscaModel.getMetadata().getVersion());

-		service.setVersion(asdcServiceMetadata.getVersion());

+		service.setVersion(serviceToscaModel.getMetadata().getVersion());

+		//service.setVersion(asdcServiceMetadata.getVersion());

 

 		return service;

 	}

diff --git a/vid-app-common/src/main/resources/sdcservices.json b/vid-app-common/src/main/resources/sdcservices.json
index e80caa6..81a08d9 100644
--- a/vid-app-common/src/main/resources/sdcservices.json
+++ b/vid-app-common/src/main/resources/sdcservices.json
@@ -4,7 +4,7 @@
       "uuid": "48a52540-8772-4368-9cdb-1f124ea5c931",
       "invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
       "name": "4-27_vMME_Service",
-      "version": "1.0",
+      "version": "0.1",
       "toscaModelURL": "./service-vf-csar.zip",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",
@@ -15,10 +15,10 @@
       "resources": null
     },
     {
-      "uuid": "cb49608f-5a24-4789-b0f7-2595473cb997",
+      "uuid": "68101369-6f08-4e99-9a28-fa6327d344f3",
       "invariantUUID": "0311f998-9268-4fd6-bbba-afff15087b72",
       "name": "4-27_vMME_Service",
-      "version": "1.0",
+      "version": "0.1",
       "toscaModelURL": "./service-vl-csar.zip",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",
@@ -32,7 +32,7 @@
       "uuid": "73e1322a-8a9a-49dc-9558-b0c5c5770e4a",
       "invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
       "name": "4-27_vMME_Service",
-      "version": "1.0",
+      "version": "0.1",
       "toscaModelURL": "./pnf.csar",
       "category": "Mobility",
       "lifecycleState": "CERTIFIED",