fixed input string type issue in bp_gen 19/103019/2
authorDhrumin Desai <dd303q@att.com>
Tue, 3 Mar 2020 22:56:23 +0000 (17:56 -0500)
committerDhrumin Desai <dd303q@att.com>
Wed, 4 Mar 2020 15:56:11 +0000 (10:56 -0500)
Issue-ID: DCAEGEN2-2120
Change-Id: I95f6c3093377921250adf7089eca96f38b838f93
Signed-off-by: Dhrumin Desai <dd303q@att.com>
mod/bpgenerator/src/main/java/org/onap/blueprintgenerator/models/blueprint/Blueprint.java

index 7ba4d22..c043a9e 100644 (file)
@@ -80,20 +80,21 @@ public class Blueprint {
                }
                return bp;
        }
+
        public Blueprint setQuotations(Blueprint bp) {
                for(String s: bp.getInputs().keySet()) {
                        LinkedHashMap<String, Object> temp = bp.getInputs().get(s);
                        if(temp.get("type") == "string") {
                                String def = (String) temp.get("default");
-                               if(def != null && def.equals("")){
-                                       String emptyString = "\"\"";
-                                       Object emptyObj = emptyString;
-                                       temp.put("default", emptyObj);
+                               if(def != null){
+                                       def = def.replaceAll("\"$", "").replaceAll("^\"", "");
                                }
+                               def = '"' + def + '"';
+                               temp.replace("default", def);
                                bp.getInputs().replace(s, temp);
                        }
                }
-               
+
                return bp;
        }