summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java')
-rw-r--r--ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java
index 9d5e4fea..2c6827ed 100644
--- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java
+++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java
@@ -65,6 +65,8 @@ import org.onap.portalsdk.core.onboarding.exception.CipherUtilException;
import org.onap.portalsdk.core.onboarding.exception.PortalAPIException;
import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
import org.onap.portalsdk.core.onboarding.util.CipherUtil;
+import org.onap.portalsdk.core.onboarding.util.KeyConstants;
+import org.onap.portalsdk.core.onboarding.util.KeyProperties;
import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
import org.onap.portalsdk.core.restful.domain.EcompRole;
@@ -83,7 +85,7 @@ import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.context.ApplicationContext;
@RunWith(PowerMockRunner.class)
-@PrepareForTest({ AppContextManager.class, PortalApiProperties.class, JSONUtil.class, PortalTimeoutHandler.class, SystemProperties.class, CipherUtil.class })
+@PrepareForTest({ AppContextManager.class, PortalApiProperties.class, JSONUtil.class, PortalTimeoutHandler.class, SystemProperties.class, CipherUtil.class, KeyProperties.class, KeyConstants.class })
public class OnBoardingApiServiceImplTest {
@Mock
@@ -426,7 +428,9 @@ public class OnBoardingApiServiceImplTest {
PowerMockito.mockStatic(SystemProperties.class);
PowerMockito.mockStatic(CipherUtil.class);
- Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(key);
+ PowerMockito.mockStatic(KeyProperties.class);
+ PowerMockito.mockStatic(KeyConstants.class);
+ Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(key);
Mockito.when(CipherUtil.decryptPKC(app.getAppPassword(), key)).thenReturn(app.getAppPassword());
Mockito.when(appServiceImpl.getDefaultApp()).thenReturn(app);
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();
@@ -453,7 +457,9 @@ public class OnBoardingApiServiceImplTest {
PowerMockito.mockStatic(SystemProperties.class);
PowerMockito.mockStatic(CipherUtil.class);
- Mockito.when(SystemProperties.getProperty(SystemProperties.Decryption_Key)).thenReturn(key);
+ PowerMockito.mockStatic(KeyProperties.class);
+ PowerMockito.mockStatic(KeyConstants.class);
+ Mockito.when(KeyProperties.getProperty(KeyConstants.CIPHER_ENCRYPTION_KEY)).thenReturn(key);
Mockito.when(CipherUtil.decryptPKC(app.getAppPassword(), key)).thenThrow(CipherUtilException.class);
Mockito.when(appServiceImpl.getDefaultApp()).thenReturn(app);
OnBoardingApiServiceImpl onBoardingApiServiceImpl = new OnBoardingApiServiceImpl();