diff options
Diffstat (limited to 'asdc-controller/src/test')
-rw-r--r-- | asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInputTest.java | 26 | ||||
-rw-r--r-- | asdc-controller/src/test/resources/schema.sql | 4 |
2 files changed, 26 insertions, 4 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 844adeede2..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 @@ -33,10 +33,7 @@ import org.onap.sdc.toscaparser.api.parameters.Input; import org.onap.so.asdc.client.exceptions.ArtifactInstallerException; import org.onap.so.asdc.installer.ToscaResourceStructure; import org.onap.so.db.catalog.beans.Service; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.LinkedHashMap; +import java.util.*; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.any; import static org.mockito.Mockito.when; @@ -61,6 +58,27 @@ public class ToscaResourceInputTest { Input input; @Test + public void getListResourceInput() { + 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); + } + + @Test public void processResourceSequenceTest() { ToscaResourceInstaller toscaResourceInstaller = new ToscaResourceInstaller(); ToscaResourceStructure toscaResourceStructure = new ToscaResourceStructure(); diff --git a/asdc-controller/src/test/resources/schema.sql b/asdc-controller/src/test/resources/schema.sql index 8cc5ee9d49..0e8024da0a 100644 --- a/asdc-controller/src/test/resources/schema.sql +++ b/asdc-controller/src/test/resources/schema.sql @@ -806,6 +806,7 @@ CREATE TABLE `service` ( `WORKLOAD_CONTEXT` varchar(200) DEFAULT NULL, `SERVICE_CATEGORY` varchar(200) DEFAULT NULL, `RESOURCE_ORDER` varchar(200) default NULL, + OVERALL_DISTRIBUTION_STATUS varchar(45), PRIMARY KEY (`MODEL_UUID`), KEY `fk_service__tosca_csar1_idx` (`TOSCA_CSAR_ARTIFACT_UUID`), CONSTRAINT `fk_service__tosca_csar1` FOREIGN KEY (`TOSCA_CSAR_ARTIFACT_UUID`) REFERENCES `tosca_csar` (`ARTIFACT_UUID`) ON DELETE CASCADE ON UPDATE CASCADE @@ -1109,6 +1110,7 @@ CREATE TABLE `vnf_resource_customization` ( `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `VNF_RESOURCE_MODEL_UUID` varchar(200) NOT NULL, `SERVICE_MODEL_UUID` varchar(200) NOT NULL, + `VNFCINSTANCEGROUP_ORDER` varchar(200) default NULL, PRIMARY KEY (`ID`), UNIQUE KEY `UK_vnf_resource_customization` (`MODEL_CUSTOMIZATION_UUID`,`SERVICE_MODEL_UUID`), KEY `fk_vnf_resource_customization__vnf_resource1_idx` (`VNF_RESOURCE_MODEL_UUID`), @@ -1135,6 +1137,8 @@ CREATE TABLE `vnfc_customization` ( `MODEL_NAME` varchar(200) NOT NULL, `TOSCA_NODE_TYPE` varchar(200) NOT NULL, `DESCRIPTION` varchar(1200) DEFAULT NULL, + `RESOURCE_INPUT` varchar(20000) DEFAULT NULL, + `VNFC_INSTANCE_GROUP_CUSTOMIZATION_ID` integer DEFAULT NULL, `CREATION_TIMESTAMP` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`MODEL_CUSTOMIZATION_UUID`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; |