2 * Copyright 2018 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.aai.esr.entity.aai;
18 import static org.junit.Assert.assertEquals;
19 import java.util.ArrayList;
20 import java.util.List;
21 import org.junit.Test;
23 public class RelationshipTest {
25 public void getterAndSetter4relatedTo() {
26 final String relatedTo = "relationship-key";
27 Relationship relationship = new Relationship();
28 relationship.setRelatedTo(relatedTo);
29 assertEquals(relationship.getRelatedTo(), relatedTo);
33 public void getterAndSetter4relatedLink() {
34 final String relatedLink = "123";
35 Relationship relationship = new Relationship();
36 relationship.setRelatedLink(relatedLink);
37 assertEquals(relationship.getRelatedLink(), relatedLink);
41 public void getterAndSetter4relationshipData() {
42 Relationship relationship = new Relationship();
43 List<RelationshipData> relationshipDatas = new ArrayList<>();
44 RelationshipData relationshipData = new RelationshipData();
45 relationshipData.setRelationshipKey("relationship-key");
46 relationshipData.setRelationshipValue("123");
47 relationshipDatas.add(relationshipData);
48 relationship.setRelationshipData(relationshipDatas);
49 assertEquals(relationship.getRelationshipData(), relationshipDatas);