diff options
author | Tomasz Wrobel <tomasz.wrobel@nokia.com> | 2021-01-26 13:27:57 +0100 |
---|---|---|
committer | Tomasz Wrobel <tomasz.wrobel@nokia.com> | 2021-01-27 09:18:53 +0100 |
commit | 5cfbc4a1f1187eb330f5e88b3d9965d5732b5581 (patch) | |
tree | 56f0a00369ef54d564107a4df458aaf9c6fb18e0 /mod/bpgenerator/onap/src/main | |
parent | 12bf7f388e919df51f869b5449f23a082082394d (diff) |
Bp-generator, fix app-config inputs in different types
Issue-ID: DCAEGEN2-1179
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I0a368f47e0737d8870144de8ab25a385e922f2a3
Diffstat (limited to 'mod/bpgenerator/onap/src/main')
-rw-r--r-- | mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java index da70511..b31fc49 100644 --- a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java +++ b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/AppConfigService.java @@ -43,8 +43,7 @@ import java.util.TreeMap; /** * @author : Ravi Mantena - * @date 10/16/2020 Application: ONAP - Blueprint Generator Common ONAP Service used to create App - * Config + * @date 10/16/2020 Application: ONAP - Blueprint Generator Common ONAP Service used to create App Config */ @Service("onapAppConfigService") public class AppConfigService { @@ -60,12 +59,12 @@ public class AppConfigService { /** - * Creates Inputs section under App Config with Publishes, Subscribes, Parameters sections by - * checking Datarouter/MessageRouter/override/Dmaap values + * Creates Inputs section under App Config with Publishes, Subscribes, Parameters sections by checking + * Datarouter/MessageRouter/override/Dmaap values * - * @param inputs Inputs + * @param inputs Inputs * @param onapComponentSpec Onap Component Specification - * @param isDmaap Dmaap Argument + * @param isDmaap Dmaap Argument * @return */ public Map<String, Object> createAppconfig( @@ -95,8 +94,7 @@ public class AppConfigService { paramInput.setBpInputName(pName); parameters.put(pName, paramInput); if (!"".equals(p.getValue())) { - LinkedHashMap<String, Object> pInputs = - blueprintHelperService.createStringInput(p.getValue()); + LinkedHashMap<String, Object> pInputs = createInputFromParameter(p); inputs.put(pName, pInputs); } else { LinkedHashMap<String, Object> pInputs = new LinkedHashMap<>(); @@ -124,4 +122,9 @@ public class AppConfigService { return response; } + private LinkedHashMap<String, Object> createInputFromParameter(Parameters parameter) { + String inputType = parameter.getType() == null ? "string" : parameter.getType(); + + return blueprintHelperService.createInputByType(inputType, parameter.getValue()); + } } |