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.VendorLicenseModelRequestDto;
23 import org.testng.annotations.Test;
26 public class MapVendorLicenseModelRequestDtoToVendorLicenseModelEntityTest {
29 public void testDescription() {
30 VendorLicenseModelRequestDto source = new VendorLicenseModelRequestDto();
31 VendorLicenseModelEntity target = new VendorLicenseModelEntity();
32 MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity mapper =
33 new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity();
34 String param = "b77cbdda-ad74-49df-81e6-60438f5f5ff5";
35 source.setDescription(param);
36 mapper.doMapping(source, target);
37 assertEquals(target.getDescription(), param);
41 public void testVendorName() {
42 VendorLicenseModelRequestDto source = new VendorLicenseModelRequestDto();
43 VendorLicenseModelEntity target = new VendorLicenseModelEntity();
44 MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity mapper =
45 new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity();
46 String param = "e0559039-599b-447c-a859-fec2cc26e08d";
47 source.setVendorName(param);
48 mapper.doMapping(source, target);
49 assertEquals(target.getVendorName(), param);
53 public void testIconRef() {
54 VendorLicenseModelRequestDto source = new VendorLicenseModelRequestDto();
55 VendorLicenseModelEntity target = new VendorLicenseModelEntity();
56 MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity mapper =
57 new MapVendorLicenseModelRequestDtoToVendorLicenseModelEntity();
58 String param = "e79f4e78-ff71-4033-a8d8-3b86d08c9366";
59 source.setIconRef(param);
60 mapper.doMapping(source, target);
61 assertEquals(target.getIconRef(), param);