From: Rodrigo Lima Date: Tue, 19 May 2020 16:10:17 +0000 (-0400) Subject: remove powermock dependency from pom xmls X-Git-Tag: 1.7.0~119 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F87%2F107887%2F2;p=sdc.git remove powermock dependency from pom xmls - Remove powermock from pom xml files - Remove powermock from ActivityLogManagerFactoryImplTest Issue-ID: SDC-3071 Signed-off-by: Rodrigo Lima Change-Id: I4c4b8b0751f4ce8895617a951429111fc08d8e2e --- diff --git a/asdctool/pom.xml b/asdctool/pom.xml index e6ff5c6221..b685620bab 100644 --- a/asdctool/pom.xml +++ b/asdctool/pom.xml @@ -506,12 +506,6 @@ io.netty netty-handler - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml index a74d594ce8..7f34e15c56 100644 --- a/catalog-be/pom.xml +++ b/catalog-be/pom.xml @@ -464,10 +464,6 @@ slf4j-log4j12 org.slf4j - - powermock-api-mockito - org.powermock - org.onap.aaf.authz aaf-cadi-aaf diff --git a/catalog-model/pom.xml b/catalog-model/pom.xml index 5fd10f7316..051313602f 100644 --- a/catalog-model/pom.xml +++ b/catalog-model/pom.xml @@ -281,18 +281,6 @@ ${commons-jci-core.version} test - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito-common - 1.7.4 - test - org.codehaus.groovy diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/externaltesting-rest/externaltesting-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/externaltesting-rest/externaltesting-rest-services/pom.xml index 036a072659..184ed4cd76 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/externaltesting-rest/externaltesting-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/externaltesting-rest/externaltesting-rest-services/pom.xml @@ -128,24 +128,6 @@ mockito-core test - - org.powermock - powermock-module-junit4-common - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - org.openecomp.sdc openecomp-sdc-externaltesting-impl diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml index 1c4e61d406..6cd5727baa 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/pom.xml @@ -136,24 +136,6 @@ unique-type-rest-types ${project.version} - - org.powermock - powermock-module-junit4-common - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml index 5dd93c33f4..ca548b44e5 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/pom.xml @@ -46,24 +46,6 @@ ${project.version} runtime - - org.powermock - powermock-module-junit4-common - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java index 82d5ae10d7..c1dd5d0a75 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImpl.java @@ -20,8 +20,16 @@ import org.openecomp.sdc.activitylog.ActivityLogManagerFactory; import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory; public class ActivityLogManagerFactoryImpl extends ActivityLogManagerFactory { - private static final ActivityLogManager INSTANCE = - new ActivityLogManagerImpl(ActivityLogDaoFactory.getInstance().createInterface()); + private final ActivityLogManager INSTANCE; + + + public ActivityLogManagerFactoryImpl() { + this.INSTANCE = new ActivityLogManagerImpl(ActivityLogDaoFactory.getInstance().createInterface()); + } + + ActivityLogManagerFactoryImpl(ActivityLogManager activityLogManager) { + this.INSTANCE = activityLogManager; + } @Override public ActivityLogManager createInterface() { diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogDaoStub.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogDaoStub.java similarity index 100% rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogDaoStub.java rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogDaoStub.java diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java similarity index 52% rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java index c00bcc3b54..4784d54862 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerFactoryImplTest.java @@ -20,42 +20,18 @@ package org.openecomp.sdc.activitylog.impl; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; +import org.junit.jupiter.api.Test; +import static org.mockito.Mockito.mock; import org.openecomp.sdc.activitylog.ActivityLogManager; -import org.openecomp.sdc.activitylog.dao.ActivityLogDao; -import org.openecomp.sdc.activitylog.dao.ActivityLogDaoFactory; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; -import static org.junit.Assert.assertNotNull; -import static org.mockito.MockitoAnnotations.initMocks; -import static org.powermock.api.mockito.PowerMockito.when; +import static org.junit.jupiter.api.Assertions.assertNotNull; -@RunWith(PowerMockRunner.class) -@PrepareForTest(ActivityLogDaoFactory.class) public class ActivityLogManagerFactoryImplTest { - @Mock - ActivityLogDaoFactory activityLogDaoFactory; - @Mock - ActivityLogDao activityLogDao; - - @Before - public void setUp(){ - initMocks(this); - PowerMockito.mockStatic(ActivityLogDaoFactory.class); - when(ActivityLogDaoFactory.getInstance()).thenReturn(activityLogDaoFactory); - when(activityLogDaoFactory.createInterface()).thenReturn(activityLogDao); - - } - @Test public void createInterfaceTest(){ - ActivityLogManager activityLogManager = new ActivityLogManagerFactoryImpl().createInterface(); + ActivityLogManager activityLogManager = + new ActivityLogManagerFactoryImpl(mock(ActivityLogManager.class)).createInterface(); assertNotNull(activityLogManager); } } diff --git a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java similarity index 89% rename from openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java rename to openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java index 0ce6098c61..44a4b20cc9 100644 --- a/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/main/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-activity-log-manager/src/test/java/org/openecomp/sdc/activitylog/impl/ActivityLogManagerImplTest.java @@ -20,9 +20,8 @@ package org.openecomp.sdc.activitylog.impl; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; +import org.junit.jupiter.api.Test; +import org.mockito.Mockito; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdc.versioning.dao.types.Version; @@ -33,18 +32,11 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.mockito.MockitoAnnotations.initMocks; public class ActivityLogManagerImplTest { private ActivityLogManagerImpl activityLogManager; - @Mock - private ActivityLogDaoStub activityLogDao; - - @Before - public void setUp(){ - initMocks(this); - } + private ActivityLogDaoStub activityLogDao = Mockito.mock(ActivityLogDaoStub.class); @Test public void logActivityTest(){ diff --git a/openecomp-be/backend/openecomp-sdc-security-util/pom.xml b/openecomp-be/backend/openecomp-sdc-security-util/pom.xml index dc114db09f..d9370ac6af 100644 --- a/openecomp-be/backend/openecomp-sdc-security-util/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-security-util/pom.xml @@ -62,25 +62,6 @@ test - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - junit - junit - - - - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml index 26030edc44..7b23506bac 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/pom.xml @@ -160,24 +160,6 @@ openecomp-sdc-activity-log-manager ${project.version} - - org.powermock - powermock-module-junit4-common - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - org.openecomp.sdc openecomp-sdc-activity-log-api diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml index c87b3e5c56..8daff53abe 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml @@ -26,19 +26,6 @@ ${servlet-api.version} provided - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - - - org.powermock - powermock-api-mockito2 - ${powermock.version} - test - org.projectlombok lombok diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/pom.xml index 4a324b1dd2..938787c202 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-core/pom.xml @@ -34,24 +34,6 @@ ${easymock.version} test - - org.powermock - powermock-api-easymock - ${powermock.version} - test - - - org.powermock - powermock-core - ${powermock.version} - test - - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - diff --git a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml index 3a8413a219..15b3a6a21c 100644 --- a/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-notification-lib/openecomp-sdc-notification-core/pom.xml @@ -40,12 +40,6 @@ mockito-core test - - org.powermock - powermock-module-junit4 - ${powermock.version} - test - diff --git a/pom.xml b/pom.xml index c7e972ac53..798ab3aabc 100644 --- a/pom.xml +++ b/pom.xml @@ -106,7 +106,6 @@ Modifications copyright (c) 2018-2019 Nokia 1.1 - 2.0.7 3.3.3 3.3.3 1.35