Added oparent to sdc main
[sdc.git] / catalog-model / src / test / java / org / openecomp / sdc / be / model / RelationshipInfoTest.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 import org.openecomp.sdc.be.datatypes.elements.RelationshipInstDataDefinition;
26
27 public class RelationshipInfoTest {
28
29         private RelationshipInfo createTestSubject() {
30                 return new RelationshipInfo();
31         }
32         
33         @Test
34         public void testCtor() throws Exception {
35                 new RelationshipInfo("mock", new RelationshipImpl());
36                 new RelationshipInfo("mock", new RelationshipImpl(), "mock");
37         }
38         
39         @Test
40         public void testGetRequirement() throws Exception {
41                 RelationshipInfo testSubject;
42                 String result;
43
44                 // default test
45                 testSubject = createTestSubject();
46                 result = testSubject.getRequirement();
47         }
48
49         @Test
50         public void testSetRequirement() throws Exception {
51                 RelationshipInfo testSubject;
52                 String requirement = "";
53
54                 // default test
55                 testSubject = createTestSubject();
56                 testSubject.setRequirement(requirement);
57         }
58
59         @Test
60         public void testGetCapabilityOwnerId() throws Exception {
61                 RelationshipInfo testSubject;
62                 String result;
63
64                 // default test
65                 testSubject = createTestSubject();
66                 result = testSubject.getCapabilityOwnerId();
67         }
68
69         @Test
70         public void testSetCapabilityOwnerId() throws Exception {
71                 RelationshipInfo testSubject;
72                 String capabilityOwnerId = "";
73
74                 // default test
75                 testSubject = createTestSubject();
76                 testSubject.setCapabilityOwnerId(capabilityOwnerId);
77         }
78
79         @Test
80         public void testGetRequirementOwnerId() throws Exception {
81                 RelationshipInfo testSubject;
82                 String result;
83
84                 // default test
85                 testSubject = createTestSubject();
86                 result = testSubject.getRequirementOwnerId();
87         }
88
89         @Test
90         public void testSetRequirementOwnerId() throws Exception {
91                 RelationshipInfo testSubject;
92                 String requirementOwnerId = "";
93
94                 // default test
95                 testSubject = createTestSubject();
96                 testSubject.setRequirementOwnerId(requirementOwnerId);
97         }
98
99         @Test
100         public void testGetRelationship() throws Exception {
101                 RelationshipInfo testSubject;
102                 RelationshipImpl result;
103
104                 // default test
105                 testSubject = createTestSubject();
106                 result = testSubject.getRelationship();
107         }
108
109         @Test
110         public void testSetRelationships() throws Exception {
111                 RelationshipInfo testSubject;
112                 RelationshipImpl relationship = null;
113
114                 // default test
115                 testSubject = createTestSubject();
116                 testSubject.setRelationships(relationship);
117         }
118
119         @Test
120         public void testGetCapability() throws Exception {
121                 RelationshipInfo testSubject;
122                 String result;
123
124                 // default test
125                 testSubject = createTestSubject();
126                 result = testSubject.getCapability();
127         }
128
129         @Test
130         public void testSetCapability() throws Exception {
131                 RelationshipInfo testSubject;
132                 String capability = "";
133
134                 // default test
135                 testSubject = createTestSubject();
136                 testSubject.setCapability(capability);
137         }
138
139         @Test
140         public void testGetCapabilityUid() throws Exception {
141                 RelationshipInfo testSubject;
142                 String result;
143
144                 // default test
145                 testSubject = createTestSubject();
146                 result = testSubject.getCapabilityUid();
147         }
148
149         @Test
150         public void testSetCapabilityUid() throws Exception {
151                 RelationshipInfo testSubject;
152                 String capabilityUid = "";
153
154                 // default test
155                 testSubject = createTestSubject();
156                 testSubject.setCapabilityUid(capabilityUid);
157         }
158
159         @Test
160         public void testGetRequirementUid() throws Exception {
161                 RelationshipInfo testSubject;
162                 String result;
163
164                 // default test
165                 testSubject = createTestSubject();
166                 result = testSubject.getRequirementUid();
167         }
168
169         @Test
170         public void testSetRequirementUid() throws Exception {
171                 RelationshipInfo testSubject;
172                 String requirementUid = "";
173
174                 // default test
175                 testSubject = createTestSubject();
176                 testSubject.setRequirementUid(requirementUid);
177         }
178
179         @Test
180         public void testGetId() throws Exception {
181                 RelationshipInfo testSubject;
182                 String result;
183
184                 // default test
185                 testSubject = createTestSubject();
186                 result = testSubject.getId();
187         }
188
189         @Test
190         public void testSetId() throws Exception {
191                 RelationshipInfo testSubject;
192                 String id = "";
193
194                 // default test
195                 testSubject = createTestSubject();
196                 testSubject.setId(id);
197         }
198
199         @Test
200         public void testToString() throws Exception {
201                 RelationshipInfo testSubject;
202                 String result;
203
204                 // default test
205                 testSubject = createTestSubject();
206                 result = testSubject.toString();
207         }
208
209         @Test
210         public void testEqualsTo() throws Exception {
211                 RelationshipInfo testSubject;
212                 RelationshipInstDataDefinition savedRelation = null;
213                 boolean result;
214
215                 // test 1
216                 testSubject = createTestSubject();
217                 result = testSubject.equalsTo(savedRelation);
218                 Assert.assertEquals(false, result);
219                 savedRelation = new RelationshipInstDataDefinition();
220                 RelationshipImpl relationship = new RelationshipImpl();
221                 savedRelation.setType("mock");
222                 testSubject.setRelationships(relationship);
223                 result = testSubject.equalsTo(savedRelation);
224                 Assert.assertEquals(false, result);
225                 relationship.setType("mock");
226                 savedRelation.setCapabilityOwnerId("mock");
227                 result = testSubject.equalsTo(savedRelation);
228                 Assert.assertEquals(false, result);
229                 testSubject.setCapabilityOwnerId("mock");
230                 savedRelation.setRequirementOwnerId("mock");
231                 result = testSubject.equalsTo(savedRelation);
232                 Assert.assertEquals(false, result);
233                 savedRelation.setRequirementOwnerId("mock");
234                 result = testSubject.equalsTo(savedRelation);
235                 Assert.assertEquals(false, result);
236                 testSubject.setRequirementOwnerId("mock");
237                 savedRelation.setRequirementId("mock");
238                 result = testSubject.equalsTo(savedRelation);
239                 Assert.assertEquals(false, result);
240                 testSubject.setRequirementUid("mock");
241                 savedRelation.setCapabilityId("mock");
242                 result = testSubject.equalsTo(savedRelation);
243                 Assert.assertEquals(false, result);
244                 testSubject.setCapabilityUid("mock");
245                 savedRelation.setRequirement("mock");
246                 result = testSubject.equalsTo(savedRelation);
247                 Assert.assertEquals(false, result);
248                 testSubject.setRequirement("mock");
249                 result = testSubject.equalsTo(savedRelation);
250                 Assert.assertEquals(true, result);
251         }
252 }