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.sdc.vendorsoftwareproduct.types.LicensingData;
24 import org.openecomp.sdc.versioning.dao.types.Version;
25 import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspDetailsDto;
28 * This class was generated.
30 public class MapVspDetailsToDtoTest {
33 public void testConversion() {
35 final VspDetails source = new VspDetails();
37 final String id = "072b88a8-0b34-4e3e-a0be-1f664100f76c";
40 final String versionId = "345-96f20205613f";
41 final Version version = new Version(versionId);
42 source.setVersion(version);
44 final String name = "cd60b1d0-cf2f-48b4-b578-96f20205613f";
47 final String description = "3baf3188-c7b4-48a2-9b4d-0258216ce4b5";
48 source.setDescription(description);
50 final String category = "d05d10e3-35d6-45aa-83a5-f41194468fc2";
51 source.setCategory(category);
53 final String subCategory = "9a4652df-ff91-4817-bfa0-ded9fd57012e";
54 source.setSubCategory(subCategory);
56 final String icon = "2ee3b647-f3f0-4c85-9134-b4e960246b06";
59 final String vendorName = "e9351739-6a2b-4214-b386-e71dc48ff97d";
60 source.setVendorName(vendorName);
62 final String vendorId = "b2f67f43-3b19-4037-a982-ed7bc2ed8d68";
63 source.setVendorId(vendorId);
65 final String vlmVersionId = "3b194037a982ed7b";
66 source.setVlmVersion(new Version(vlmVersionId));
68 final String onboardingMethod = "b46520ac-e62f-4a24-8f40-ee6e65889bfc";
69 source.setOnboardingMethod(onboardingMethod);
71 final VspDetailsDto target = new VspDetailsDto();
72 final MapVspDetailsToDto mapper = new MapVspDetailsToDto();
73 mapper.doMapping(source, target);
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());