summaryrefslogtreecommitdiffstats
path: root/asdc-controller/src/test/java
diff options
context:
space:
mode:
authorzm330 <zhangminyj@chinamobile.com>2019-05-07 00:07:22 +0800
committerzm330 <zhangminyj@chinamobile.com>2019-05-07 16:21:07 +0800
commit5595d82ee5120b863a833e1e45b262d80f7dc6a1 (patch)
treef0b852e367b4f83083595e7b6ed4d0eb0398b14f /asdc-controller/src/test/java
parent7af16eec7a5ea196de57b47b918d3d88390a715c (diff)
Update the format of resourceInput
Save format when resource is list type e.g. {key2:[vf_prop_list,INDEX,key]|default} Issue-ID: SO-1393 Change-Id: Ibb5e7bb31114fa3bbd7a3e1af5f2152a98941a4b Signed-off-by: zm330 <zhangminyj@chinamobile.com>
Diffstat (limited to 'asdc-controller/src/test/java')
-rw-r--r--asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
index f6a369e405..846eaf47e2 100644
--- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
+++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java
@@ -62,16 +62,20 @@ public class ToscaResourceInputTest {
ToscaResourceInstaller toscaResourceInstaller = new ToscaResourceInstaller();
LinkedHashMap<String, Property> hashMap = new LinkedHashMap<>();
hashMap.put("key1", property);
+ Map<String, Object> map = new HashMap<>();
+ map.put("customizationUUID", "69df3303-d2b3-47a1-9d04-41604d3a95fd");
+ Metadata metadata = new Metadata(map);
when(nodeTemplate.getProperties()).thenReturn(hashMap);
when(property.getValue()).thenReturn(getInput);
when(getInput.getInputName()).thenReturn("nameKey");
when(input.getName()).thenReturn("nameKey");
when(input.getDefault()).thenReturn("defaultValue");
when(getInput.toString()).thenReturn("getinput:[sites,INDEX,role]");
+ when(nodeTemplate.getMetaData()).thenReturn(metadata);
List<Input> inputs = new ArrayList<>();
inputs.add(input);
String resourceInput = toscaResourceInstaller.getVnfcResourceInput(nodeTemplate, inputs);
- assertEquals("{\\\"key1\\\":\\\"sites,INDEX,role|defaultValue\\\"}", resourceInput);
+ assertEquals("{\\\"key1\\\":\\\"[sites,INDEX,role]|defaultValue\\\"}", resourceInput);
}
@Test