summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-os/src/main/java
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-06-21 12:12:06 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-06-21 12:12:12 +0200
commitcaf5dec3f7ddb89fc26b7579e5d7f15ac54e500c (patch)
tree4aaebff594ee12bc2808454a4be798672ced1bb0 /ecomp-portal-BE-os/src/main/java
parent62be40d079c97648353c1ad45819d3a24ff82fe5 (diff)
ONAPLoginController sonar issues fix.
Sonar issues fix plus @Autowired in constructor not in fields. Issue-ID: PORTAL-651 Change-Id: I99329b986877d040c6fdda9daf42a5c501a39605 Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-os/src/main/java')
-rw-r--r--ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java37
1 files changed, 21 insertions, 16 deletions
diff --git a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
index 1da1d1bb..98cd790f 100644
--- a/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
+++ b/ecomp-portal-BE-os/src/main/java/org/onap/portalapp/controller/ONAPLoginController.java
@@ -37,12 +37,10 @@
*/
package org.onap.portalapp.controller;
-import java.util.HashMap;
-import java.util.Map;
-
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import lombok.NoArgsConstructor;
import org.onap.portalsdk.core.auth.LoginStrategy;
import org.onap.portalsdk.core.controller.UnRestrictedBaseController;
import org.onap.portalsdk.core.onboarding.listener.PortalTimeoutHandler;
@@ -57,14 +55,20 @@ import org.springframework.web.servlet.ModelAndView;
@Controller
@RequestMapping("/")
+@NoArgsConstructor
public class ONAPLoginController extends UnRestrictedBaseController {
- @Autowired
- ProfileService service;
- @Autowired
+ private ProfileService service;
private LoginService loginService;
- @Autowired
private LoginStrategy loginStrategy;
- String viewName;
+ private String viewName;
+
+ @Autowired
+ public ONAPLoginController(ProfileService service, LoginService loginService,
+ LoginStrategy loginStrategy) {
+ this.service = service;
+ this.loginService = loginService;
+ this.loginStrategy = loginStrategy;
+ }
@RequestMapping(value = { "/doLogin" }, method = RequestMethod.GET)
public ModelAndView doLogin(HttpServletRequest request, HttpServletResponse response) throws Exception {
@@ -80,14 +84,6 @@ public class ONAPLoginController extends UnRestrictedBaseController {
PortalTimeoutHandler.sessionCreated(jSessionId, jSessionId, AppUtils.getSession(request));
}
- public String getViewName() {
- return viewName;
- }
-
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
-
public LoginService getLoginService() {
return loginService;
}
@@ -96,4 +92,13 @@ public class ONAPLoginController extends UnRestrictedBaseController {
this.loginService = loginService;
}
+ @Override
+ public String getViewName() {
+ return viewName;
+ }
+
+ @Override
+ public void setViewName(String viewName) {
+ this.viewName = viewName;
+ }
}