d5eb7be0d3bec612b7e539868f1d5b9a7e1d0628
[sdc.git] /
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.vsp.rest.mapping;
18
19 import static org.junit.Assert.assertEquals;
20
21 import org.junit.Test;
22 import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails;
23 import org.openecomp.sdc.vendorsoftwareproduct.types.LicensingData;
24 import org.openecomp.sdc.versioning.dao.types.Version;
25 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
26
27 /**
28  * This class was generated.
29  */
30 public class MapVspDetailsToDtoTest {
31
32     @Test()
33     public void testConversion() {
34
35         final VspDetails source = new VspDetails();
36
37         final String id = "072b88a8-0b34-4e3e-a0be-1f664100f76c";
38         source.setId(id);
39
40         final String versionId = "345-96f20205613f";
41         final Version version = new Version(versionId);
42         source.setVersion(version);
43
44         final String name = "cd60b1d0-cf2f-48b4-b578-96f20205613f";
45         source.setName(name);
46
47         final String description = "3baf3188-c7b4-48a2-9b4d-0258216ce4b5";
48         source.setDescription(description);
49
50         final String category = "d05d10e3-35d6-45aa-83a5-f41194468fc2";
51         source.setCategory(category);
52
53         final String subCategory = "9a4652df-ff91-4817-bfa0-ded9fd57012e";
54         source.setSubCategory(subCategory);
55
56         final String icon = "2ee3b647-f3f0-4c85-9134-b4e960246b06";
57         source.setIcon(icon);
58
59         final String vendorName = "e9351739-6a2b-4214-b386-e71dc48ff97d";
60         source.setVendorName(vendorName);
61
62         final String vendorId = "b2f67f43-3b19-4037-a982-ed7bc2ed8d68";
63         source.setVendorId(vendorId);
64
65         final String vlmVersionId = "3b194037a982ed7b";
66         source.setVlmVersion(new Version(vlmVersionId));
67
68         final String onboardingMethod = "b46520ac-e62f-4a24-8f40-ee6e65889bfc";
69         source.setOnboardingMethod(onboardingMethod);
70
71         final VspDetailsDto target = new VspDetailsDto();
72         final MapVspDetailsToDto mapper = new MapVspDetailsToDto();
73         mapper.doMapping(source, target);
74
75         assertEquals(id, source.getId());
76         assertEquals(versionId, target.getVersion());
77         assertEquals(name, target.getName());
78         assertEquals(description, target.getDescription());
79         assertEquals(icon, target.getIcon());
80         assertEquals(category, target.getCategory());
81         assertEquals(subCategory, target.getSubCategory());
82         assertEquals(vendorId, target.getVendorId());
83         assertEquals(vendorName, target.getVendorName());
84         assertEquals(vlmVersionId, target.getLicensingVersion());
85         assertEquals(onboardingMethod, target.getOnboardingMethod());
86     }
87 }