diff options
Diffstat (limited to 'ecomp-sdk/epsdk-app-common')
5 files changed, 13 insertions, 9 deletions
diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ManifestController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ManifestController.java index 65964fe5..0fd3cfbb 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ManifestController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ManifestController.java @@ -45,7 +45,6 @@ import java.util.jar.Attributes; import java.util.jar.Manifest; import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; import org.onap.portalsdk.core.controller.RestrictedBaseController; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileController.java index 74c18850..c7edfb81 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/core/ProfileController.java @@ -88,7 +88,7 @@ public class ProfileController extends RestrictedBaseController { @RequestMapping(value = { "/profile" }, method = RequestMethod.GET) public ModelAndView profile(HttpServletRequest request) throws IOException { - Map<String, Object> model = new HashMap<String, Object>(); + Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); User user = UserUtils.getUserSession(request); @@ -138,7 +138,7 @@ public class ProfileController extends RestrictedBaseController { @RequestMapping(value = { "/get_self_profile" }, method = RequestMethod.GET) public void getSelfProfile(HttpServletRequest request, HttpServletResponse response) { - Map<String, Object> model = new HashMap<String, Object>(); + Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); User user = UserUtils.getUserSession(request); diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/AngularSinglePageController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/AngularSinglePageController.java index b5d78768..96b602c3 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/AngularSinglePageController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/AngularSinglePageController.java @@ -59,7 +59,7 @@ public class AngularSinglePageController extends RestrictedBaseController { @RequestMapping(value = { "/singlePageSample" }, method = RequestMethod.GET) public ModelAndView view(HttpServletRequest request) { - Map<String, Object> model = new HashMap<String, Object>(); + Map<String, Object> model = new HashMap<>(); return new ModelAndView("single_page_sample", "model", model); } diff --git a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java index ec300780..c36ffcc9 100644 --- a/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java +++ b/ecomp-sdk/epsdk-app-common/src/main/java/org/onap/portalapp/controller/sample/BroadcastController.java @@ -73,7 +73,7 @@ public class BroadcastController extends RestrictedBaseController { @RequestMapping(value = { "/broadcast" }, method = RequestMethod.GET) public ModelAndView broadcast(HttpServletRequest request) { - Map<String, Object> model = new HashMap<String, Object>(); + Map<String, Object> model = new HashMap<>(); ObjectMapper mapper = new ObjectMapper(); try { diff --git a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java index 6ddcbcfb..989394d6 100644 --- a/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java +++ b/ecomp-sdk/epsdk-app-common/src/test/java/org/onap/portalapp/service/OnBoardingApiServiceImplTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START========================================== * ONAP Portal SDK * =================================================================== - * Copyright © 2017 AT&T Intellectual Property. All rights reserved. + * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. * =================================================================== * * Unless otherwise specified, all software contained herein is licensed @@ -264,6 +264,8 @@ public class OnBoardingApiServiceImplTest { @Test public void pushUserRoleTest() throws Exception { String loginId = "123"; + App app = new App(); + app.setId(1l); List<EcompRole> rolesJson = new ArrayList<>(); EcompRole role1 = new EcompRole(); role1.setId(123L); @@ -274,12 +276,13 @@ public class OnBoardingApiServiceImplTest { Role role = new Role(); role.setId(123L); userApp.setRole(role); + userApp.setApp(app); UserApp userApp2 = new UserApp(); Role role2 = new Role(); role2.setId(124L); userApp2.setRole(role2); - + userApp2.setApp(app); userApps.add(userApp); userApps.add(userApp2); User user = new User(); @@ -292,9 +295,10 @@ public class OnBoardingApiServiceImplTest { Assert.assertTrue(true); } - @Test(expected = PortalAPIException.class) + @Test public void pushUserRoleExceptionTest() throws Exception { String loginId = "123"; + App app = new App(); List<EcompRole> rolesJson = new ArrayList<>(); EcompRole role1 = new EcompRole(); role1.setId(123L); @@ -304,7 +308,8 @@ public class OnBoardingApiServiceImplTest { UserApp userApp = new UserApp(); Role role = new Role(); role.setId(123L); - + userApp.setApp(app); + userApp.setRole(role); userApps.add(userApp); User user = new User(); user.setUserApps(userApps); |