2 * Copyright © 2016-2018 European Support Limited
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.
17 package org.openecomp.sdcrests.vendorlicense.rest.mapping;
19 import static org.testng.Assert.assertEquals;
21 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
22 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
23 import org.testng.annotations.Test;
26 public class MapFeatureGroupEntityToFeatureGroupDescriptorDtoTest {
29 public void testDescription() {
30 FeatureGroupEntity source = new FeatureGroupEntity();
31 FeatureGroupDescriptorDto target = new FeatureGroupDescriptorDto();
32 MapFeatureGroupEntityToFeatureGroupDescriptorDto mapper =
33 new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
34 String param = "0173a1e0-f713-413c-854b-152d35228616";
35 source.setDescription(param);
36 mapper.doMapping(source, target);
37 assertEquals(target.getDescription(), param);
41 public void testName() {
42 FeatureGroupEntity source = new FeatureGroupEntity();
43 FeatureGroupDescriptorDto target = new FeatureGroupDescriptorDto();
44 MapFeatureGroupEntityToFeatureGroupDescriptorDto mapper =
45 new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
46 String param = "d0a3212d-06c6-455e-ab36-b1fd63eefeca";
47 source.setName(param);
48 mapper.doMapping(source, target);
49 assertEquals(target.getName(), param);
53 public void testPartNumber() {
54 FeatureGroupEntity source = new FeatureGroupEntity();
55 FeatureGroupDescriptorDto target = new FeatureGroupDescriptorDto();
56 MapFeatureGroupEntityToFeatureGroupDescriptorDto mapper =
57 new MapFeatureGroupEntityToFeatureGroupDescriptorDto();
58 String param = "562265f0-abe0-44e9-9ee4-3cf2f5436ea9";
59 source.setPartNumber(param);
60 mapper.doMapping(source, target);
61 assertEquals(target.getPartNumber(), param);