diff options
author | vempo <vitaliy.emporopulo@amdocs.com> | 2018-11-17 18:34:56 +0200 |
---|---|---|
committer | Oren Kleks <orenkle@amdocs.com> | 2018-11-18 07:38:18 +0000 |
commit | a53296cab00e739a6b6a177048f3a3bb9c0f298f (patch) | |
tree | a6a734fc2979609ef811d39b584f036690dd61b5 /openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest | |
parent | 03fb4087901e4cf56b02f6a9456d987f28844a2f (diff) |
Unit-test for mappers in item permissions
Change-Id: I047da38c9345aba1079e9ce360587a8d0650d10e
Issue-ID: SDC-1917
Signed-off-by: vempo <vitaliy.emporopulo@amdocs.com>
Diffstat (limited to 'openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest')
2 files changed, 51 insertions, 7 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml index f56a988066..e17c1c2059 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/pom.xml @@ -12,33 +12,27 @@ <artifactId>item-permissions-rest-services</artifactId> - <dependencies> - <dependency> <groupId>org.openecomp.sdc</groupId> <artifactId>item-permissions-rest-types</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.openecomp.sdc</groupId> <artifactId>openecomp-sdc-common-rest</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>org.openecomp.sdc</groupId> <artifactId>openecomp-sdc-item-permissions-manager</artifactId> <version>${project.version}</version> </dependency> - <dependency> <groupId>javax.inject</groupId> <artifactId>javax.inject</artifactId> <version>${javax.inject.version}</version> </dependency> - <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-models</artifactId> @@ -47,7 +41,11 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> - <version>${spring.framework.version}</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> </dependency> </dependencies> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/test/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDtoTest.java b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/test/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDtoTest.java new file mode 100644 index 0000000000..431be95103 --- /dev/null +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/item-permissions-rest/item-permissions-rest-services/src/test/java/org/openecomp/sdcrests/itempermissions/rest/mapping/MapItemPermissionsToItemPermissionsDtoTest.java @@ -0,0 +1,46 @@ +/* + * Copyright © 2016-2018 European Support Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.openecomp.sdcrests.itempermissions.rest.mapping; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity; +import org.openecomp.sdcrests.itempermissions.types.ItemPermissionsDto; + +/** + * This class was generated. + */ +public class MapItemPermissionsToItemPermissionsDtoTest { + + @Test + public void testConversion() { + + final ItemPermissionsEntity source = new ItemPermissionsEntity(); + final String userId = "23b32755-a837-41bb-9216-aeb8243fd470"; + source.setUserId(userId); + final String permission = "5069e4f8-ae49-4dfd-8b78-58291ec85b2b"; + source.setPermission(permission); + + final ItemPermissionsDto target = new ItemPermissionsDto(); + final MapItemPermissionsToItemPermissionsDto mapper = new MapItemPermissionsToItemPermissionsDto(); + mapper.doMapping(source, target); + + assertEquals(userId, target.getUserId()); + assertEquals(permission, target.getPermission()); + } +} |