035d36707ead7c373b11678ae21d074333d8d217
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / test / java / org / openecomp / sdcrests / vendorlicense / rest / mapping / MapFeatureGroupDescriptorDtoToFeatureGroupEntityTest.java
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.sdcrests.vendorlicense.rest.mapping;
18
19 import static org.testng.Assert.assertEquals;
20
21 import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity;
22 import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupDescriptorDto;
23 import org.testng.annotations.Test;
24
25
26 public class MapFeatureGroupDescriptorDtoToFeatureGroupEntityTest {
27
28     @Test
29     public void testName() {
30         FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
31         FeatureGroupEntity target = new FeatureGroupEntity();
32         MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
33                 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
34         String param = "bf328e2e-8c77-440b-8485-d6a5a54e604a";
35         source.setName(param);
36         mapper.doMapping(source, target);
37         assertEquals(target.getName(), param);
38     }
39
40     @Test
41     public void testDescription() {
42         FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
43         FeatureGroupEntity target = new FeatureGroupEntity();
44         MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
45                 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
46         String param = "6361dbd3-07e5-40db-bffc-00aaf0c1e16e";
47         source.setDescription(param);
48         mapper.doMapping(source, target);
49         assertEquals(target.getDescription(), param);
50     }
51
52     @Test
53     public void testPartNumber() {
54         FeatureGroupDescriptorDto source = new FeatureGroupDescriptorDto();
55         FeatureGroupEntity target = new FeatureGroupEntity();
56         MapFeatureGroupDescriptorDtoToFeatureGroupEntity mapper =
57                 new MapFeatureGroupDescriptorDtoToFeatureGroupEntity();
58         String param = "4a99afe6-8493-42d3-92df-62c03dd1d55e";
59         source.setPartNumber(param);
60         mapper.doMapping(source, target);
61         assertEquals(target.getPartNumber(), param);
62     }
63 }