Catalog alignment
[sdc.git] / catalog-be / src / test / java / org / openecomp / sdc / be / datamodel / ServiceRelationsTest.java
1 /*
2
3  * Copyright (c) 2018 Huawei Intellectual Property.
4
5  *
6
7  * Licensed under the Apache License, Version 2.0 (the "License");
8
9  * you may not use this file except in compliance with the License.
10
11  * You may obtain a copy of the License at
12
13  *
14
15  *     http://www.apache.org/licenses/LICENSE-2.0
16
17  *
18
19  * Unless required by applicable law or agreed to in writing, software
20
21  * distributed under the License is distributed on an "AS IS" BASIS,
22
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
25  * See the License for the specific language governing permissions and
26
27  * limitations under the License.
28
29  */
30
31 package org.openecomp.sdc.be.datamodel;
32
33 import org.junit.Test;
34
35 import java.util.HashSet;
36 import java.util.Set;
37
38 import static org.assertj.core.api.Assertions.assertThat;
39
40 public class ServiceRelationsTest {
41
42         private NameIdPair getNameIdPairWrapper() {
43                 return new NameIdPair("mock", "mock");
44         }
45
46         @Test
47         public void testServiceRelations()  {
48
49                 NameIdPairWrapper testNameIdPairWrapper;
50                 NameIdPair nameIdPair = new NameIdPair("mock", "mock");
51
52                 testNameIdPairWrapper =  new NameIdPairWrapper();
53                 testNameIdPairWrapper.init(nameIdPair);
54
55                 Set<NameIdPairWrapper> result = new HashSet<NameIdPairWrapper>();
56                 result.add(testNameIdPairWrapper);
57
58
59                 ServiceRelations testServiceRelations = new ServiceRelations();
60                 ServiceRelations testServiceRelationsWithRelations = new ServiceRelations(result);
61                 testServiceRelations.setRelations(result);
62                 Set<NameIdPairWrapper> getResult = testServiceRelations.getRelations();
63                 assertThat(getResult).isEqualTo(result);
64         }
65
66 }