Implement 'Update Service by importing Tosca Template'-story
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / tosca / model / ToscaTemplateTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.tosca.model;
22
23 import org.junit.Test;
24
25 import java.util.HashMap;
26 import java.util.List;
27 import java.util.Map;
28
29 import static org.junit.Assert.assertEquals;
30
31 public class ToscaTemplateTest {
32
33         private ToscaTemplate createTestSubject() {
34                 return new ToscaTemplate("");
35         }
36
37         
38         @Test
39         public void testGetNode_types() throws Exception {
40                 ToscaTemplate testSubject;
41                 Map<String, ToscaNodeType> result;
42
43                 // default test
44                 testSubject = createTestSubject();
45                 result = testSubject.getNode_types();
46         }
47
48         
49         @Test
50         public void testSetNode_types() throws Exception {
51                 ToscaTemplate testSubject;
52                 Map<String, ToscaNodeType> node_types = null;
53
54                 // default test
55                 testSubject = createTestSubject();
56                 testSubject.setNode_types(node_types);
57         }
58
59         
60         @Test
61         public void testGetImports() throws Exception {
62                 ToscaTemplate testSubject;
63                 List<Map<String, Map<String, String>>> result;
64
65                 // default test
66                 testSubject = createTestSubject();
67                 result = testSubject.getImports();
68         }
69
70         
71         @Test
72         public void testSetImports() throws Exception {
73                 ToscaTemplate testSubject;
74                 List<Map<String, Map<String, String>>> imports = null;
75
76                 // default test
77                 testSubject = createTestSubject();
78                 testSubject.setImports(imports);
79         }
80
81         
82         @Test
83         public void testGetTosca_definitions_version() throws Exception {
84                 ToscaTemplate testSubject;
85                 String result;
86
87                 // default test
88                 testSubject = createTestSubject();
89                 result = testSubject.getTosca_definitions_version();
90         }
91
92         
93         @Test
94         public void testSetTosca_definitions_version() throws Exception {
95                 ToscaTemplate testSubject;
96                 String tosca_definitions_version = "";
97
98                 // default test
99                 testSubject = createTestSubject();
100                 testSubject.setTosca_definitions_version(tosca_definitions_version);
101         }
102
103         
104         @Test
105         public void testGetMetadata() throws Exception {
106                 ToscaTemplate testSubject;
107                 Map<String, Object> result;
108
109                 // default test
110                 testSubject = createTestSubject();
111                 result = testSubject.getMetadata();
112         }
113
114         
115         @Test
116         public void testSetMetadata() throws Exception {
117                 ToscaTemplate testSubject;
118                 Map<String, Object> metadata = null;
119
120                 // default test
121                 testSubject = createTestSubject();
122                 testSubject.setMetadata(metadata);
123         }
124
125         
126         @Test
127         public void testGetTopology_template() throws Exception {
128                 ToscaTemplate testSubject;
129                 ToscaTopolgyTemplate result;
130
131                 // default test
132                 testSubject = createTestSubject();
133                 result = testSubject.getTopology_template();
134         }
135
136         
137         @Test
138         public void testSetTopology_template() throws Exception {
139                 ToscaTemplate testSubject;
140                 ToscaTopolgyTemplate topology_template = null;
141
142                 // default test
143                 testSubject = createTestSubject();
144                 testSubject.setTopology_template(topology_template);
145         }
146
147
148         @Test
149         public void testGetSetData_types() throws Exception {
150                 ToscaTemplate testSubject = createTestSubject();
151                 Map<String, ToscaDataType> dataTypes = new HashMap<>();
152                 dataTypes.put("datatype", new ToscaDataType());
153                 testSubject.setData_types(dataTypes);
154                 assertEquals(dataTypes, testSubject.getData_types());
155         }
156
157
158         @Test
159         public void testGetSetInterface_types() throws Exception {
160                 ToscaTemplate testSubject = createTestSubject();
161                 Map<String, Object> interfaceTypes = new HashMap<>();
162                 interfaceTypes.put("id", new Object());
163                 testSubject.setInterface_types(interfaceTypes);
164                 assertEquals(interfaceTypes, testSubject.getInterface_types());
165         }
166
167 }