From 230c71614b1d2fb71a8fb482c749ff5a6dad65d8 Mon Sep 17 00:00:00 2001 From: "Ikramullah, Ikram (fi241c)" Date: Fri, 22 May 2020 13:11:56 -0400 Subject: fixes for supporting non-gui application access provisioning Issue-ID: PORTAL-909 Change-Id: I760eb93966cec6d2cf9a24f06e3424ab867b38f6 Signed-off-by: Muni Mohan Kunchi --- .../service/RemoteWebServiceCallServiceImpl.java | 4 ++-- .../service/RemoteWebServiceCallServiceImplTest.java | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'ecomp-portal-BE-os/src') diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java index a24a6b4c..8b92b58c 100644 --- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java +++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/service/RemoteWebServiceCallServiceImpl.java @@ -69,8 +69,8 @@ public class RemoteWebServiceCallServiceImpl extends WebServiceCallServiceImpl i return false; } - String encryptedPwdDB = appRecord.getAppPassword(); - String appUserName = appRecord.getUsername(); + String encryptedPwdDB = appRecord.getAppBasicAuthPassword(); + String appUserName = appRecord.getAppBasicAuthUsername(); String decryptedPwd = CipherUtil.decryptPKC(encryptedPwdDB, secretKey == null ? SystemProperties.getProperty(SystemProperties.Decryption_Key) : secretKey); if (decryptedPwd.equals(requestPassword) && appUserName.equals(requestAppName)) diff --git a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java index 88ccf5d1..5b7f7d45 100644 --- a/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java +++ b/ecomp-portal-BE-os/src/test/java/org/onap/portalapp/portal/service/RemoteWebServiceCallServiceImplTest.java @@ -97,7 +97,7 @@ public class RemoteWebServiceCallServiceImplTest { String criteria= " where ueb_key = 'requestUebKey'"; List appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); + app.setAppBasicAuthPassword("password"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; @@ -115,8 +115,8 @@ public class RemoteWebServiceCallServiceImplTest { String criteria= " where ueb_key = 'requestUebKey'"; List appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); String secretKey = null; @@ -134,8 +134,8 @@ public class RemoteWebServiceCallServiceImplTest { String criteria= " where ueb_key = 'requestUebKey'"; List appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null); String secretKey = null; @@ -160,8 +160,8 @@ public class RemoteWebServiceCallServiceImplTest { // String criteria= " where ueb_key = 'requestUebKey'"; List appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(null); assertFalse(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test")); @@ -175,8 +175,8 @@ public class RemoteWebServiceCallServiceImplTest { String criteria= " where ueb_key = 'test'"; List appList = new ArrayList<>(); EPApp app = new EPApp(); - app.setAppPassword("password"); - app.setUsername("requestAppName"); + app.setAppBasicAuthPassword("password"); + app.setAppBasicAuthUsername("requestAppName"); appList.add(app); Mockito.when(dataAccessService.getList(EPApp.class, criteria.toString(), null, null)).thenReturn(appList); assertTrue(remoteWebServiceCallServiceImpl.verifyAppKeyCredential("test")); -- cgit 1.2.3-korg