Implement 'Update Service by importing Tosca Template'-story
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / tosca / model / ToscaTemplateTest.java
index 3c60e96..362a42a 100644 (file)
@@ -1,12 +1,32 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
 package org.openecomp.sdc.be.tosca.model;
 
+import org.junit.Test;
+
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.annotation.Generated;
-
-import org.junit.Test;
-
+import static org.junit.Assert.assertEquals;
 
 public class ToscaTemplateTest {
 
@@ -84,7 +104,7 @@ public class ToscaTemplateTest {
        @Test
        public void testGetMetadata() throws Exception {
                ToscaTemplate testSubject;
-               ToscaMetadata result;
+               Map<String, Object> result;
 
                // default test
                testSubject = createTestSubject();
@@ -95,7 +115,7 @@ public class ToscaTemplateTest {
        @Test
        public void testSetMetadata() throws Exception {
                ToscaTemplate testSubject;
-               ToscaMetadata metadata = null;
+               Map<String, Object> metadata = null;
 
                // default test
                testSubject = createTestSubject();
@@ -124,9 +144,24 @@ public class ToscaTemplateTest {
                testSubject.setTopology_template(topology_template);
        }
 
-       
 
+       @Test
+       public void testGetSetData_types() throws Exception {
+               ToscaTemplate testSubject = createTestSubject();
+               Map<String, ToscaDataType> dataTypes = new HashMap<>();
+               dataTypes.put("datatype", new ToscaDataType());
+               testSubject.setData_types(dataTypes);
+               assertEquals(dataTypes, testSubject.getData_types());
+       }
 
-       
 
-}
\ No newline at end of file
+       @Test
+       public void testGetSetInterface_types() throws Exception {
+               ToscaTemplate testSubject = createTestSubject();
+               Map<String, Object> interfaceTypes = new HashMap<>();
+               interfaceTypes.put("id", new Object());
+               testSubject.setInterface_types(interfaceTypes);
+               assertEquals(interfaceTypes, testSubject.getInterface_types());
+       }
+
+}