b40c6692e57f3f8ab88161739ac499cf7765feee
[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 / MapVendorLicenseModelEntityToDtoTest.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.VendorLicenseModelEntity;
22 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
23 import org.testng.annotations.Test;
24
25
26 public class MapVendorLicenseModelEntityToDtoTest {
27
28     @Test
29     public void testIconRef() {
30         VendorLicenseModelEntity source = new VendorLicenseModelEntity();
31         VendorLicenseModelEntityDto target = new VendorLicenseModelEntityDto();
32         MapVendorLicenseModelEntityToDto mapper = new MapVendorLicenseModelEntityToDto();
33         String param = "3d3aed28-341a-490e-94b0-c7d4a520b64a";
34         source.setIconRef(param);
35         mapper.doMapping(source, target);
36         assertEquals(target.getIconRef(), param);
37     }
38
39     @Test
40     public void testDescription() {
41         VendorLicenseModelEntity source = new VendorLicenseModelEntity();
42         VendorLicenseModelEntityDto target = new VendorLicenseModelEntityDto();
43         MapVendorLicenseModelEntityToDto mapper = new MapVendorLicenseModelEntityToDto();
44         String param = "68dc3641-94ad-4109-8082-62037720739b";
45         source.setDescription(param);
46         mapper.doMapping(source, target);
47         assertEquals(target.getDescription(), param);
48     }
49
50     @Test
51     public void testId() {
52         VendorLicenseModelEntity source = new VendorLicenseModelEntity();
53         VendorLicenseModelEntityDto target = new VendorLicenseModelEntityDto();
54         MapVendorLicenseModelEntityToDto mapper = new MapVendorLicenseModelEntityToDto();
55         String param = "019b68df-92d9-40a6-a5b0-951d64838ce9";
56         source.setId(param);
57         mapper.doMapping(source, target);
58         assertEquals(target.getId(), param);
59     }
60
61     @Test
62     public void testVendorName() {
63         VendorLicenseModelEntity source = new VendorLicenseModelEntity();
64         VendorLicenseModelEntityDto target = new VendorLicenseModelEntityDto();
65         MapVendorLicenseModelEntityToDto mapper = new MapVendorLicenseModelEntityToDto();
66         String param = "99319b1a-5cea-459d-aff6-7a4be4f318c0";
67         source.setVendorName(param);
68         mapper.doMapping(source, target);
69         assertEquals(target.getVendorName(), param);
70     }
71 }