Validate request bodies in controller methods
[portal/ric-dashboard.git] / dashboard / webapp-backend / src / test / java / org / oransc / ric / portal / dashboard / config / WebSecurityMockConfiguration.java
index 257b4a4..afa9711 100644 (file)
@@ -21,7 +21,6 @@ package org.oransc.ric.portal.dashboard.config;
 
 import java.lang.invoke.MethodHandles;
 
-import org.onap.portalsdk.core.onboarding.crossapi.IPortalRestCentralService;
 import org.oransc.ric.portal.dashboard.DashboardConstants;
 import org.oransc.ric.portal.dashboard.portalapi.PortalAuthManager;
 import org.slf4j.Logger;
@@ -52,12 +51,18 @@ public class WebSecurityMockConfiguration extends WebSecurityConfigurerAdapter {
 
        // Although constructor arguments are recommended over field injection,
        // this results in fewer lines of code.
+       @Value("${portalapi.security}")
+       private Boolean portalapiSecurity;
+       @Value("${portalapi.appname}")
+       private String appName;
+       @Value("${portalapi.username}")
+       private String portalApiUsername;
+       @Value("${portalapi.password}")
+       private String portalApiPassword;
        @Value("${portalapi.decryptor}")
        private String decryptor;
        @Value("${portalapi.usercookie}")
        private String userCookie;
-       @Value("${userfile}")
-       private String userFilePath;
 
        @Override
        protected void configure(AuthenticationManagerBuilder auth) throws Exception {
@@ -92,10 +97,8 @@ public class WebSecurityMockConfiguration extends WebSecurityConfigurerAdapter {
 
        @Bean
        public PortalAuthManager portalAuthManagerBean() throws Exception {
-               logger.debug("portalAuthManagerBean");
-               return new PortalAuthManager(IPortalRestCentralService.CREDENTIALS_APP,
-                               IPortalRestCentralService.CREDENTIALS_USER, IPortalRestCentralService.CREDENTIALS_PASS, decryptor,
-                               userCookie);
+               logger.debug("portalAuthManagerBean: app {}", appName);
+               return new PortalAuthManager(appName, portalApiUsername, portalApiPassword, decryptor, userCookie);
        }
 
 }