2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.be.tosca.model;
23 import org.junit.Test;
25 import java.util.HashMap;
26 import java.util.List;
29 import static org.junit.Assert.assertEquals;
31 public class ToscaTemplateTest {
33 private ToscaTemplate createTestSubject() {
34 return new ToscaTemplate("");
39 public void testGetNode_types() throws Exception {
40 ToscaTemplate testSubject;
41 Map<String, ToscaNodeType> result;
44 testSubject = createTestSubject();
45 result = testSubject.getNode_types();
50 public void testSetNode_types() throws Exception {
51 ToscaTemplate testSubject;
52 Map<String, ToscaNodeType> node_types = null;
55 testSubject = createTestSubject();
56 testSubject.setNode_types(node_types);
61 public void testGetImports() throws Exception {
62 ToscaTemplate testSubject;
63 List<Map<String, Map<String, String>>> result;
66 testSubject = createTestSubject();
67 result = testSubject.getImports();
72 public void testSetImports() throws Exception {
73 ToscaTemplate testSubject;
74 List<Map<String, Map<String, String>>> imports = null;
77 testSubject = createTestSubject();
78 testSubject.setImports(imports);
83 public void testGetTosca_definitions_version() throws Exception {
84 ToscaTemplate testSubject;
88 testSubject = createTestSubject();
89 result = testSubject.getTosca_definitions_version();
94 public void testSetTosca_definitions_version() throws Exception {
95 ToscaTemplate testSubject;
96 String tosca_definitions_version = "";
99 testSubject = createTestSubject();
100 testSubject.setTosca_definitions_version(tosca_definitions_version);
105 public void testGetMetadata() throws Exception {
106 ToscaTemplate testSubject;
107 Map<String, String> result;
110 testSubject = createTestSubject();
111 result = testSubject.getMetadata();
116 public void testSetMetadata() throws Exception {
117 ToscaTemplate testSubject;
118 Map<String, String> metadata = null;
121 testSubject = createTestSubject();
122 testSubject.setMetadata(metadata);
127 public void testGetTopology_template() throws Exception {
128 ToscaTemplate testSubject;
129 ToscaTopolgyTemplate result;
132 testSubject = createTestSubject();
133 result = testSubject.getTopology_template();
138 public void testSetTopology_template() throws Exception {
139 ToscaTemplate testSubject;
140 ToscaTopolgyTemplate topology_template = null;
143 testSubject = createTestSubject();
144 testSubject.setTopology_template(topology_template);
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());
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());