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;
20 import static org.junit.jupiter.api.Assertions.assertEquals;
22 import org.junit.jupiter.api.Test;
23 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
24 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
27 class MapFeatureGroupDescriptorDtoToFeatureGroupEntityTest {
31 FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
32 FeatureGroupEntity target = new FeatureGroupEntity();
33 MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
34 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
35 String param = "bf328e2e-8c77-440b-8485-d6a5a54e604a";
36 source.setName(param);
37 mapper.doMapping(source, target);
38 assertEquals(target.getName(), param);
42 void testDescription() {
43 FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
44 FeatureGroupEntity target = new FeatureGroupEntity();
45 MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
46 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
47 String param = "6361dbd3-07e5-40db-bffc-00aaf0c1e16e";
48 source.setDescription(param);
49 mapper.doMapping(source, target);
50 assertEquals(target.getDescription(), param);
54 void testPartNumber() {
55 FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
56 FeatureGroupEntity target = new FeatureGroupEntity();
57 MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
58 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
59 String param = "4a99afe6-8493-42d3-92df-62c03dd1d55e";
60 source.setPartNumber(param);
61 mapper.doMapping(source, target);
62 assertEquals(target.getPartNumber(), param);