Unit-tests in notification, validation, VLM
[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 / MapLimitRequestDtoToLimitEntityTest.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.Assert.assertEquals;
20
21 import org.junit.Test;
22 import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity;
23 import org.openecomp.sdc.vendorlicense.dao.types.LimitType;
24 import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto;
25
26 /**
27  * This class was generated.
28  */
29 public class MapLimitRequestDtoToLimitEntityTest {
30
31     @Test()
32     public void testConversion() {
33
34         final LimitRequestDto source = new LimitRequestDto();
35
36         final String name = "d35387ba-b2da-4b96-b4bb-3fcc947729b6";
37         source.setName(name);
38
39         final String description = "b58fb468-023f-4336-86de-3ef588f60d75";
40         source.setDescription(description);
41
42         final LimitType type = LimitType.Vendor;
43         source.setType(type.name());
44
45         final String metric = "139d3366-fd6b-4167-83cc-ac78de1d08ab";
46         source.setMetric(metric);
47
48         final String value = "eb4a1266-92ea-4c9d-82aa-12c2cf8b3d63";
49         source.setValue(value);
50
51         final String unit = "86c66de7-a02c-461b-88ce-6875cf9b1225";
52         source.setUnit(unit);
53
54         final String time = "7352b6b5-2d47-4bfc-a7d1-5fe2b1fba4e0";
55         source.setTime(time);
56
57         final LimitEntity target = new LimitEntity();
58         final MapLimitRequestDtoToLimitEntity mapper = new MapLimitRequestDtoToLimitEntity();
59         mapper.doMapping(source, target);
60
61         assertEquals(name, target.getName());
62         assertEquals(description, target.getDescription());
63         assertEquals(type, target.getType());
64         assertEquals(metric, target.getMetric());
65         assertEquals(value, target.getValue());
66         assertEquals(unit, target.getUnit());
67         assertEquals(time, target.getTime());
68     }
69 }