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.model;
23 import org.junit.Assert;
24 import org.junit.Test;
26 import java.util.HashMap;
27 import java.util.LinkedList;
28 import java.util.List;
31 public class ComponentInstInputsMapTest {
33 private ComponentInstInputsMap createTestSubject() {
34 return new ComponentInstInputsMap();
38 public void testGetComponentInstanceInputsMap() throws Exception {
39 ComponentInstInputsMap testSubject;
40 Map<String, List<ComponentInstancePropInput>> result;
43 testSubject = createTestSubject();
44 result = testSubject.getComponentInstanceInputsMap();
48 public void testSetComponentInstanceInputsMap() throws Exception {
49 ComponentInstInputsMap testSubject;
50 Map<String, List<ComponentInstancePropInput>> componentInstanceInputsMap = null;
53 testSubject = createTestSubject();
54 testSubject.setComponentInstanceInputsMap(componentInstanceInputsMap);
58 public void testGetComponentInstanceProperties() throws Exception {
59 ComponentInstInputsMap testSubject;
60 Map<String, List<ComponentInstancePropInput>> result;
63 testSubject = createTestSubject();
64 result = testSubject.getComponentInstanceProperties();
68 public void testSetComponentInstancePropInput() throws Exception {
69 ComponentInstInputsMap testSubject;
70 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = new HashMap<>();
73 testSubject = createTestSubject();
74 testSubject.setComponentInstanceProperties(componentInstanceProperties);
78 public void testResolvePropertiesToDeclareEmpty() throws Exception {
79 ComponentInstInputsMap testSubject;
80 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
83 testSubject = createTestSubject();
85 testSubject.resolvePropertiesToDeclare();
86 } catch (Exception e) {
87 Assert.assertTrue(e.getClass() == IllegalStateException.class);
92 public void testResolvePropertiesToDeclare() throws Exception {
93 ComponentInstInputsMap testSubject;
94 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
96 Map<String, List<ComponentInstancePropInput>> inputs = new HashMap<>();
97 inputs.put("mock", new LinkedList<>());
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();
111 public void testGetPolicyProperties() throws Exception {
112 ComponentInstInputsMap testSubject;
113 Map<String, List<ComponentInstancePropInput>> componentInstanceProperties = null;
116 testSubject = createTestSubject();
117 testSubject.getPolicyProperties();