Added oparent to sdc main
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / ComponentInstInputsMapTest.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.model;
22
23 import org.junit.Assert;
24 import org.junit.Test;
25
26 import java.util.HashMap;
27 import java.util.LinkedList;
28 import java.util.List;
29 import java.util.Map;
30
31 public class ComponentInstInputsMapTest {
32
33         private ComponentInstInputsMap createTestSubject() {
34                 return new ComponentInstInputsMap();
35         }
36
37         @Test
38         public void testGetComponentInstanceInputsMap() throws Exception {
39                 ComponentInstInputsMap testSubject;
40                 Map<String, List<ComponentInstancePropInput>> result;
41
42                 // default test
43                 testSubject = createTestSubject();
44                 result = testSubject.getComponentInstanceInputsMap();
45         }
46
47         @Test
48         public void testSetComponentInstanceInputsMap() throws Exception {
49                 ComponentInstInputsMap testSubject;
50                 Map<String, List<ComponentInstancePropInput>> componentInstanceInputsMap = null;
51
52                 // default test
53                 testSubject = createTestSubject();
54                 testSubject.setComponentInstanceInputsMap(componentInstanceInputsMap);
55         }
56
57         @Test
58         public void testGetComponentInstanceProperties() throws Exception {
59                 ComponentInstInputsMap testSubject;
60                 Map<String, List<ComponentInstancePropInput>> result;
61
62                 // default test
63                 testSubject = createTestSubject();
64                 result = testSubject.getComponentInstanceProperties();
65         }
66
67         @Test
68         public void testSetComponentInstancePropInput() throws Exception {
69                 ComponentInstInputsMap testSubject;
70                 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = new HashMap<>();
71
72                 // default test
73                 testSubject = createTestSubject();
74                 testSubject.setComponentInstanceProperties(componentInstanceProperties);
75         }
76
77         @Test
78         public void testResolvePropertiesToDeclareEmpty() throws Exception {
79                 ComponentInstInputsMap testSubject;
80                 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
81
82                 // default test
83                 testSubject = createTestSubject();
84                 try {
85                         testSubject.resolvePropertiesToDeclare();
86                 } catch (Exception e) {
87             Assert.assertTrue(e.getClass() == IllegalStateException.class);
88                 }
89         }
90
91         @Test
92         public void testResolvePropertiesToDeclare() throws Exception {
93                 ComponentInstInputsMap testSubject;
94                 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
95
96                 Map<String, List<ComponentInstancePropInput>> inputs = new HashMap<>();
97                 inputs.put("mock", new LinkedList<>());
98                 // default test
99                 testSubject = createTestSubject();
100                 testSubject.setComponentInstanceInputsMap(inputs);
101                 testSubject.resolvePropertiesToDeclare();
102                 testSubject = createTestSubject();
103                 testSubject.setComponentInstanceProperties(inputs);
104                 testSubject.resolvePropertiesToDeclare();
105                 testSubject = createTestSubject();
106                 testSubject.setPolicyProperties(inputs);
107                 testSubject.resolvePropertiesToDeclare();
108         }
109         
110         @Test
111         public void testGetPolicyProperties() throws Exception {
112                 ComponentInstInputsMap testSubject;
113                 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
114
115                 // default test
116                 testSubject = createTestSubject();
117                 testSubject.getPolicyProperties();
118         }
119 }