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.vendorlicense.rest.mapping;
19 import static org.junit.Assert.assertEquals;
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;
27 * This class was generated.
29 public class MapLimitRequestDtoToLimitEntityTest {
32 public void testConversion() {
34 final LimitRequestDto source = new LimitRequestDto();
36 final String name = "d35387ba-b2da-4b96-b4bb-3fcc947729b6";
39 final String description = "b58fb468-023f-4336-86de-3ef588f60d75";
40 source.setDescription(description);
42 final LimitType type = LimitType.Vendor;
43 source.setType(type.name());
45 final String metric = "139d3366-fd6b-4167-83cc-ac78de1d08ab";
46 source.setMetric(metric);
48 final String value = "eb4a1266-92ea-4c9d-82aa-12c2cf8b3d63";
49 source.setValue(value);
51 final String unit = "86c66de7-a02c-461b-88ce-6875cf9b1225";
54 final String time = "7352b6b5-2d47-4bfc-a7d1-5fe2b1fba4e0";
57 final LimitEntity target = new LimitEntity();
58 final MapLimitRequestDtoToLimitEntity mapper = new MapLimitRequestDtoToLimitEntity();
59 mapper.doMapping(source, target);
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());