Remove testNG dependencies (part 2)
[sdc.git] / openecomp-be / api / openecomp-sdc-rest-webapp / vendor-license-rest / vendor-license-rest-services / src / test / java / org / openecomp / sdcrests / vendorlicense / rest / mapping / MapLicenseAgreementDescriptorDtoToLicenseAgreementEntityTest.java
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.vendorlicense.rest.mapping;
18
19 import static org.junit.jupiter.api.Assertions.assertEquals;
20
21 import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity;
22 import org.openecomp.sdc.vendorlicense.dao.types.LicenseTerm;
23 import org.openecomp.sdcrests.vendorlicense.types.ChoiceOrOtherDto;
24 import org.openecomp.sdcrests.vendorlicense.types.LicenseAgreementDescriptorDto;
25 import org.junit.jupiter.api.Test;
26
27
28 class MapLicenseAgreementDescriptorDtoToLicenseAgreementEntityTest {
29
30     @Test
31     void testName() {
32         LicenseAgreementDescriptorDto source = new LicenseAgreementDescriptorDto();
33         LicenseAgreementEntity target = new LicenseAgreementEntity();
34         MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity mapper =
35                 new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity();
36         String param = "62d9b3aa-1d06-453f-a412-62d8cba7164d";
37         source.setName(param);
38         mapper.doMapping(source, target);
39         assertEquals(target.getName(), param);
40     }
41
42     @Test
43     void testDescription() {
44         LicenseAgreementDescriptorDto source = new LicenseAgreementDescriptorDto();
45         LicenseAgreementEntity target = new LicenseAgreementEntity();
46         MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity mapper =
47                 new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity();
48         String param = "3888dc1f-516b-4790-a5fe-73efadb2ba38";
49         source.setDescription(param);
50         mapper.doMapping(source, target);
51         assertEquals(target.getDescription(), param);
52     }
53
54     @Test
55     void testRequirementsAndConstrains() {
56         LicenseAgreementDescriptorDto source = new LicenseAgreementDescriptorDto();
57         LicenseAgreementEntity target = new LicenseAgreementEntity();
58         MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity mapper =
59                 new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity();
60         String param = "be6df4d3-b534-4c62-b611-4ed5b67e72ab";
61         source.setRequirementsAndConstrains(param);
62         mapper.doMapping(source, target);
63         assertEquals(target.getRequirementsAndConstrains(), param);
64     }
65
66     @Test
67     void testLicenseTerm() {
68         LicenseAgreementDescriptorDto source = new LicenseAgreementDescriptorDto();
69         LicenseAgreementEntity target = new LicenseAgreementEntity();
70         MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity mapper =
71                 new MapLicenseAgreementDescriptorDtoToLicenseAgreementEntity();
72         ChoiceOrOtherDto<LicenseTerm> licenseTermChoiceOrOtherDto = new ChoiceOrOtherDto<>();
73         source.setLicenseTerm(licenseTermChoiceOrOtherDto);
74         mapper.doMapping(source, target);
75         assertEquals(target.getLicenseTerm().getChoice(), licenseTermChoiceOrOtherDto.getChoice());
76     }
77 }