diff options
author | Michal Kabaj <michal.kabaj@nokia.com> | 2019-03-23 00:10:14 +0100 |
---|---|---|
committer | Michal Kabaj <michal.kabaj@nokia.com> | 2019-03-23 00:10:14 +0100 |
commit | 59b3997941ecf730beaa979c17ff6c9d303c87d5 (patch) | |
tree | 190379b7335d56ff180ddc159e3087f659801410 /vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java | |
parent | 926100a4e3d59d0dbee1f79570fca98d177d323b (diff) |
ControllerUtils tests and improvements
- added junits
- Injecting SystemPropertiesWrapper via constructor
- switched extractUserId is now instance method instead
of static
Change-Id: Ic706b780c64248e44207a1dee723981a4ca7ed74
Issue-ID: VID-449
Signed-off-by: Michal Kabaj <michal.kabaj@nokia.com>
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java index a8e1e2b02..e2a914004 100644 --- a/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java +++ b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java @@ -41,6 +41,7 @@ import org.onap.vid.roles.Role; import org.onap.vid.roles.RoleProvider; import org.onap.vid.roles.RoleValidator; import org.onap.vid.services.AaiService; +import org.onap.vid.utils.SystemPropertiesWrapper; import org.onap.vid.utils.Unchecked; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; @@ -96,9 +97,10 @@ public class AaiController extends RestrictedBaseController { private AaiService aaiService; @Autowired private RoleProvider roleProvider; - @Autowired private AAIRestInterface aaiRestInterface; + @Autowired + private SystemPropertiesWrapper systemPropertiesWrapper; /** * Welcome method. @@ -140,7 +142,7 @@ public class AaiController extends RestrictedBaseController { @RequestMapping(value = {"/getuserID"}, method = RequestMethod.GET) public ResponseEntity<String> getUserID(HttpServletRequest request) { - String userId = ControllersUtils.extractUserId(request); + String userId = new ControllersUtils(systemPropertiesWrapper).extractUserId(request); return new ResponseEntity<>(userId, HttpStatus.OK); } |