diff options
author | avigaffa <avi.gaffa@amdocs.com> | 2018-06-18 19:56:59 +0300 |
---|---|---|
committer | avigaffa <avi.gaffa@amdocs.com> | 2018-06-19 11:34:41 +0300 |
commit | aae39fb87077e4c2738d9ad11c4be25c6770d70d (patch) | |
tree | 5c86223c55e4b5c20a1d8f2ea2e2946de98eb17e /openecomp-be/lib | |
parent | dda451b79ca2f160f0a1179820a91623c0c8979e (diff) |
Change TestNG scope
Change TestNG scope to compile in artifact generator
Change-Id: I3e1edffd35a78b2cce99bac683eee32769920216
Issue-ID: SDC-1435
Signed-off-by: avigaffa <avi.gaffa@amdocs.com>
Diffstat (limited to 'openecomp-be/lib')
12 files changed, 25 insertions, 21 deletions
diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml index 0cb874de09..aea348f47d 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/pom.xml @@ -36,7 +36,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml index 0130c0a065..9d621b4323 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/pom.xml @@ -69,7 +69,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml index 0623879b96..e6922e778f 100644 --- a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml +++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/pom.xml @@ -54,6 +54,7 @@ <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> + <scope>test</scope> <version>${testng.version}</version> </dependency> diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java index 0a87c29f50..a4fcd24c25 100644 --- a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/main/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java +++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-core/src/test/java/org/openecomp/sdc/itempermissions/dao/impl/PermissionsServicesImplTest.java @@ -1,5 +1,6 @@ package org.openecomp.sdc.itempermissions.dao.impl; +import java.util.Optional; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -7,6 +8,7 @@ import org.mockito.Spy; import org.openecomp.sdc.common.session.SessionContextProviderFactory; import org.openecomp.sdc.itempermissions.PermissionsRules; import org.openecomp.sdc.itempermissions.dao.ItemPermissionsDao; +import org.openecomp.sdc.itempermissions.dao.UserPermissionsDao; import org.openecomp.sdc.itempermissions.type.ItemPermissionsEntity; import org.testng.Assert; import org.testng.annotations.BeforeMethod; @@ -35,12 +37,14 @@ public class PermissionsServicesImplTest { private static final String CHANGE_PERMISSIONS = "Change_Item_Permissions"; static { - SessionContextProviderFactory.getInstance().createInterface().create("testUser1"); + SessionContextProviderFactory.getInstance().createInterface().create("testUser1", "dox"); } @Mock private ItemPermissionsDao permissionsDaoMock; @Mock + private UserPermissionsDao userPermissionsDao; // do not delete. needed for permissionService + @Mock private PermissionsRules permissionsRules; @InjectMocks @Spy @@ -75,7 +79,7 @@ public class PermissionsServicesImplTest { @Test public void testIsAllowed(){ - when(permissionsDaoMock.getUserItemPermiission(ITEM1_ID,USER1_ID)).thenReturn(PERMISSION); + when(permissionsDaoMock.getUserItemPermission(ITEM1_ID,USER1_ID)).thenReturn(Optional.of(PERMISSION)); when(permissionsRules.isAllowed(PERMISSION,ACTION_SUBMIT)).thenReturn(true); Boolean result = permissionsServices.isAllowed(ITEM1_ID,USER1_ID,ACTION_SUBMIT); @@ -86,16 +90,15 @@ public class PermissionsServicesImplTest { @Test public void testUpdatePermissions(){ - Set<String> addedUsers = new HashSet<String>(); + Set<String> addedUsers = new HashSet<>(); addedUsers.add(USER2_ID); - permissionsServices.updateItemPermissions(ITEM1_ID,PERMISSION,addedUsers, - new HashSet<String>()); + permissionsServices.updateItemPermissions(ITEM1_ID,PERMISSION,addedUsers, new HashSet<>()); verify(permissionsRules).executeAction(ITEM1_ID,USER1_ID,CHANGE_PERMISSIONS); - verify(permissionsRules).updatePermission(ITEM1_ID,USER1_ID,PERMISSION,addedUsers,new HashSet<String>()); + verify(permissionsRules).updatePermission(ITEM1_ID,USER1_ID,PERMISSION,addedUsers, new HashSet<>()); verify(permissionsDaoMock).updateItemPermissions(ITEM1_ID,PERMISSION,addedUsers,new - HashSet<String>()); + HashSet<>()); } diff --git a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml index 6935d5a57e..3d804612ca 100644 --- a/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml +++ b/openecomp-be/lib/openecomp-item-permissions-lib/openecomp-item-permissions-impl/pom.xml @@ -23,5 +23,11 @@ <version>${project.version}</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.testng</groupId> + <artifactId>testng</artifactId> + <scope>test</scope> + <version>${testng.version}</version> + </dependency> </dependencies> </project>
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml index 9b7c210f3d..9ec80418e0 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/pom.xml @@ -28,7 +28,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml index ab15802a05..1a4c06e466 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/pom.xml @@ -29,7 +29,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml index fdceed694b..a05fb01bd7 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/pom.xml @@ -28,12 +28,6 @@ <scope>runtime</scope> </dependency> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>${junit.version}</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>org.openecomp.sdc.core</groupId> <artifactId>openecomp-utilities-lib</artifactId> <version>${project.version}</version> diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml index 90c14b4dbd..be55d2fe60 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/pom.xml @@ -24,7 +24,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml index 75b766d477..603aa6281d 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/pom.xml @@ -40,7 +40,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml index ea12a86bab..88002d9b83 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/pom.xml @@ -68,7 +68,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml index 0b7264d5f9..8affe118e1 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/pom.xml @@ -41,7 +41,7 @@ <groupId>org.testng</groupId> <artifactId>testng</artifactId> <scope>test</scope> - <version>6.8.5</version> + <version>${testng.version}</version> <exclusions> <exclusion> <artifactId>snakeyaml</artifactId> |