fixes for supporting non-gui application access provisioning
[portal.git] / ecomp-portal-BE-os / src / test / java / org / onap / portalapp / portal / service / RemoteWebServiceCallServiceImplTest.java
index ad208f3..5b7f7d4 100644 (file)
  *
  * ============LICENSE_END============================================
  *
- * ECOMP is a trademark and service mark of AT&T Intellectual Property.
+ * 
  */
 package org.onap.portalapp.portal.service;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -45,7 +46,6 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
-import org.onap.portalsdk.core.util.SystemProperties;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -55,11 +55,10 @@ import org.mockito.Mockito;
 import org.mockito.MockitoAnnotations;
 import org.onap.portalapp.portal.domain.EPApp;
 import org.onap.portalapp.portal.framework.MockitoTestSuite;
-import org.onap.portalapp.portal.service.AppsCacheService;
-import org.onap.portalapp.portal.utils.EcompPortalUtils;
 import org.onap.portalapp.service.RemoteWebServiceCallServiceImpl;
 import org.onap.portalsdk.core.onboarding.util.CipherUtil;
 import org.onap.portalsdk.core.service.DataAccessService;
+import org.onap.portalsdk.core.util.SystemProperties;
 import org.powermock.api.mockito.PowerMockito;
 import org.powermock.core.classloader.annotations.PrepareForTest;
 import org.powermock.modules.junit4.PowerMockRunner;
@@ -77,7 +76,6 @@ public class RemoteWebServiceCallServiceImplTest {
        
        @Mock
        DataAccessService dataAccessService;
-       
 
        @Before
        public void setup() {
@@ -99,7 +97,7 @@ public class RemoteWebServiceCallServiceImplTest {
                String criteria= " where ueb_key = 'requestUebKey'";
                List<EPApp> 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;
@@ -117,8 +115,8 @@ public class RemoteWebServiceCallServiceImplTest {
                String criteria= " where ueb_key = 'requestUebKey'";
                List<EPApp> 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;
@@ -136,8 +134,8 @@ public class RemoteWebServiceCallServiceImplTest {
                String criteria= " where ueb_key = 'requestUebKey'";
                List<EPApp> 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;
@@ -162,8 +160,8 @@ public class RemoteWebServiceCallServiceImplTest {
 //             String criteria= " where ueb_key = 'requestUebKey'";
                List<EPApp> 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"));
@@ -177,8 +175,8 @@ public class RemoteWebServiceCallServiceImplTest {
                String criteria= " where ueb_key = 'test'";
                List<EPApp> 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"));