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>
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 1da1d1b..98cd790 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 @@
 
 @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 @@
 		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 @@
 		this.loginService = loginService;
 	}
 
+	@Override
+	public String getViewName() {
+		return viewName;
+	}
+
+	@Override
+	public void setViewName(String viewName) {
+		this.viewName = viewName;
+	}
 }