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.vsp.rest.mapping;
19 import static org.junit.Assert.assertEquals;
21 import org.junit.Test;
22 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
23 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDescriptionDto;
26 * This class was generated.
28 public class MapVspDescriptionDtoToVspDetailsTest {
31 public void testConversion() {
33 final VspDescriptionDto source = new VspDescriptionDto();
35 final String name = "e507ee61-df86-4cbd-8efc-fc5ac7182a42";
38 final String description = "9493bf30-d5dd-4436-9cf8-917ef5a9f2c4";
39 source.setDescription(description);
41 final String icon = "593e7453-239d-4979-abc7-2b3d0c9bfa30";
44 final String category = "0dee3401-f7e5-4da4-bd36-8f88c4380884";
45 source.setCategory(category);
47 final String subCategory = "4db52d19-bb60-4490-b88a-a14d1237316a";
48 source.setSubCategory(subCategory);
50 final String vendorName = "200378cb-ee09-47fb-975b-25fe4ddd3794";
51 source.setVendorName(vendorName);
53 final String vendorId = "a634f9b4-685e-4903-b23d-572b67d1374c";
54 source.setVendorId(vendorId);
56 final VspDetails target = new VspDetails();
57 final MapVspDescriptionDtoToVspDetails mapper = new MapVspDescriptionDtoToVspDetails();
58 mapper.doMapping(source, target);
60 assertEquals(name, target.getName());
61 assertEquals(description, target.getDescription());
62 assertEquals(category, target.getCategory());
63 assertEquals(subCategory, target.getSubCategory());
64 assertEquals(icon, target.getIcon());
65 assertEquals(vendorName, target.getVendorName());
66 assertEquals(vendorId, target.getVendorId());