Fix the tosca converter
[clamp.git] / src / test / java / org / onap / clamp / clds / tosca / update / ToscaElementTest.java
diff --git a/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementTest.java b/src/test/java/org/onap/clamp/clds/tosca/update/ToscaElementTest.java
new file mode 100644 (file)
index 0000000..7ffba4e
--- /dev/null
@@ -0,0 +1,50 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP CLAMP\r
+ * ================================================================================\r
+ * Copyright (C) 2020 AT&T Intellectual Property. All rights\r
+ *                             reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END============================================\r
+ * ===================================================================\r
+ *\r
+ */\r
+\r
+package org.onap.clamp.clds.tosca.update;\r
+\r
+import java.io.IOException;\r
+import java.util.ArrayList;\r
+import java.util.Arrays;\r
+import junit.framework.TestCase;\r
+import org.onap.clamp.clds.util.ResourceFileUtil;\r
+\r
+public class ToscaElementTest extends TestCase {\r
+\r
+    /**\r
+     * Test propertiesName.\r
+     *\r
+     * @throws IOException In case of failure\r
+     */\r
+    public void testPropertiesNames() throws IOException {\r
+        ArrayList<String> reference = new ArrayList<>(Arrays.asList("actor", "operation", "target", "payload"));\r
+        ToscaConverterManager toscaConverterManager =\r
+                new ToscaConverterManager(\r
+                        ResourceFileUtil.getResourceAsString("tosca/new-converter/sampleOperationalPolicies.yaml"),\r
+                        ResourceFileUtil.getResourceAsString("clds/tosca_update/default-tosca-types.yaml"),\r
+                        ResourceFileUtil.getResourceAsString("clds/tosca_update/templates.json"));\r
+        ToscaElement toscaElement = toscaConverterManager.getComponents().get("onap.datatype.controlloop.Actor");\r
+        assertEquals(reference, toscaElement.propertiesNames());\r
+    }\r
+\r
+}\r