3 * Copyright (c) 2018 Huawei Intellectual Property.
7 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
23 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
27 * limitations under the License.
31 package org.openecomp.sdc.be.datamodel;
33 import org.junit.Test;
35 import java.util.HashSet;
38 import static org.assertj.core.api.Assertions.assertThat;
40 public class ServiceRelationsTest {
42 private NameIdPair getNameIdPairWrapper() {
43 return new NameIdPair("mock", "mock");
47 public void testServiceRelations() {
49 NameIdPairWrapper testNameIdPairWrapper;
50 NameIdPair nameIdPair = new NameIdPair("mock", "mock");
52 testNameIdPairWrapper = new NameIdPairWrapper();
53 testNameIdPairWrapper.init(nameIdPair);
55 Set<NameIdPairWrapper> result = new HashSet<NameIdPairWrapper>();
56 result.add(testNameIdPairWrapper);
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);