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.VendorLicenseModelEntity;
22 import org.openecomp.sdcrests.vendorlicense.types.VendorLicenseModelEntityDto;
23 import org.testng.annotations.Test;
26 public class MapVendorLicenseModelEntityToDtoTest {
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);
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);
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";
57 mapper.doMapping(source, target);
58 assertEquals(target.getId(), param);
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);