summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java
AgeCommit message (Collapse)AuthorFilesLines
2020-04-16Fix policy engine JUnit that hung on ubuntu 18.04uj426b1-14/+35
Replaced powermock with overridable methods. Review comments: - license data Issue-ID: POLICY-2444 Change-Id: I60916a720569a293e6c91e8278cda41b93c3c843 Signed-off-by: uj426b <uj426b@att.com> Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-18Unit/SONAR/Checkstyle in ONAP-RESTliamfallon3-23/+23
Util package of ONAP-REST, with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: Ic134408efe76b9838f5607a07f1735d12bd41032 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-15Unit/SONAR/Checkstyle in ONAP-RESTliamfallon5-26/+26
Fifth and final batch of JPA pojos (Q-Z), with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: I1cc536a5b8a0cd3c6beff068dd72381f7ae10d12 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-13Unit/SONAR/Checkstyle in ONAP-RESTliamfallon1-6/+6
Fourth batch of JPA pojos (N-P), with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: I9319b514b5c19e6837c34566dde770673d16bca3 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-12JUnit/SONAR/Checkstyle in ONAP-RESTliamfallon1-3/+3
Third batch of JPA pojos (E-M), with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: I4fee1e9fb9c8a69dd6f2f15d3e3a8844473b857b Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-07JUnit/SONAR/Checkstyle in ONAP-RESTliamfallon2-5/+5
Second batch of JPA pojos (B-D), with JUnit added and SONAR/Checkstyle issues addressed. In cases where a class name change caused an update in another package, the license header on files for those knock on changes are not updated. Issue-ID: POLICY-2131 Change-Id: I9466f27ffa606001209ed978be592ae95d1b32c4 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-10-24CHeckstyle and JUnit for base package in ONAP-RESTliamfallon8-26/+26
Added unit tests and fixed checkstyle and SONAR issues in the base package of ONAPE-REST There was a lot of knock-on automatic changes done by Eclipse when I renamed the class XACMLRestProperties to XacmlRestProperties so ignore the changes in all but the ONAP-REST package. I also didn't update the licenses on files on those classes because the changes were automatic. Issue-ID: POLICY-2131 Change-Id: I28823c844b5192f8d56de76a727996b13e7ea4a6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-10-23Consolidate PolicyRestAdapter setupPamela Dragosh19-285/+150
Put common code into PolicyEngineUtils that the controllers use to populate the PolicyRestController. Also some more sonar cleanup and formatting of XML files. Shortened 120 line characters. Removed some trailing spaces from comments. Fixed up one JUnit. Licenses. Issue-ID: POLICY-2133 Change-Id: Id7d8ac3ab60331535f048ec0f26aeb17a099414e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-14Sonar cleanup in controllers etcPamela Dragosh21-931/+939
Variable renaming of consecutive capital letters. Adding Javadoc Missing curly braces Re-writing some methods to reduce cyclomatic complexity Combining while's into a simple for statement. Addressing previous review comments No real effort on code coverage in this one. Issue-ID: POLICY-2133 Change-Id: I4afb3030203e1dbc743507e037ca3d57faf41f1d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-11Add coverage to a few ControllersPamela Dragosh3-60/+69
Cleaned up parts of the code that were useless. The coverage for 2 classes are now over 80%. The CreatePolicyController coverage is now 100% I have no idea what kind of policy the ActionPolicyController is expecting, seems bizarre so will have to leave it alone and move on. Issue-ID: POLICY-2133 Change-Id: I80629d3b6f2aba301483f3fa8c3cad16cc01ffbe Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-11More sonar cleanup and line consolidationPamela Dragosh23-753/+911
Missing javadoc and some variable naming to remove consecutive capitlization of letters. 120 line width reduction Missing curly braces Moving variables due to distance requirements Add missing rawtype suppression or useless ones There are some null return statements that are useless Started doing some combining of lines at the risk of making the code even more unreadable than it already is. Started addressing some nested if's. I see opportunity for a lot of common code to be combined or put into a base controller or utility method. Issue-ID: POLICY-2133 Change-Id: I6d4d9618bea685cf1d02899e3a9d4a43919a2a96 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-10Checkstyle and some coveragePamela Dragosh8-125/+208
Address some trailing space from previous review. Mostly this was checkstyle issues of naming methods and variables, distance from usage, missing javadoc, 120 character spacing. Did add a few trivial code coverage tests. Issue-ID: POLICY-2133 Change-Id: I159d1b27429b6bef046092ea3a4045fbd3a1071c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-08Cleanup POLICY-SDK-APP CheckPDPPamela Dragosh2-93/+111
Fixed sonar issues and added a small amount of code coverage. CheckPDP was renamed to comply with 2 consecutive capital letters. Various sonar issues done. Very difficult to get coverage on remaining area - over 82% anyway. RESTfulPAPEngine was updated to use the new renamed class and methods. Sonar issues were taken care of for the most part and added some coverage by consolidating the JUnit tests. Added in assertj as we will utilize that more throughout the repo. Issue-ID: POLICY-2133 Change-Id: Id0a9b050ebe373e155878699366d78df71bd0554 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-07Use lombok for data objectsPamela Dragosh5-325/+20
Removing lines to see if this will bump coverage. Some sonar for Junit tests and missing coverage. My next task will be to re-use some of this duplicate code for these object types and the controllers. Trailing spaces for patch #3. Issue-ID: POLICY-2133 Change-Id: Iaee123c6be4b63bd831172340709fe7597feaa78 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-07Format java POLICY-SDK-APPPamela Dragosh35-2569/+2613
As a result of doing command maven reformat, these files are now changed. Updated licenses. Issue-ID: POLICY-2133 Change-Id: I19a8dd70eb10c0d879b97635f7780ab7f92a1753 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-08-23Fix license on updated engine filesJim Hahn1-8/+7
Address review comment about license date on updated junits. Change-Id: I5dd6e47be243d6f0d5a001cb5cfb45e7ac31f9c8 Issue-ID: POLICY-1937 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-22Remove powermock to increase coverageJim Hahn1-3/+9
Removed powermock from the junit tests of these classes to increase reported sonar coverage: RESTfulPAPEngine BrmsGateway Typically added override methods to the classes under test, to replace the overrides originally provided by powermock. Also needed to add code to RESTfulPAPEngineTest to clear the XACML properties before the test ran. Modified to use the existing XACMLProperties.reloadProperties() method. Also modified PolicyNotificationMailTest to use a host/port that has no listener so that the test runs faster. Fixed some newly introduced sonar issues. Change-Id: I65e36b01e9506987032eb21baac808ed3dfd4f47 Issue-ID: POLICY-1937 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-12Fix issue for policies not loading on GUI push tabMichael Mokry1-1/+9
- found the problem to be with a line of code to add all the scopes from the role to a Set of scopes. when the scopes attribute in the role object is null it logs an exception and fails to load policies. I added a new method to check the value of the roles.getScopes() for null and only attempt to add the scope to the set if it is not null - I created a separate method to do this in order to avoid an increase in technical debt as it would have added to the complexity if I kept it in the same method. - PATCH 4: Added scopes to the method arguments in order to avoid overwriting scopes that are added in prevous interations of the loop. - PATCH 5: removed redundant scopes assignment per Jorge's review. Change-Id: Ifcc8775d3db8ecc722ee6806310a58ecb4e15856 Issue-ID: POLICY-1981 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-04-09Merge "Fix Sonar issues in org.onap.policy.controller pkg"Pamela Dragosh4-1070/+1056
2019-04-09Fix Sonar issues in org.onap.policy.controller pkgRashmi Pujar4-1070/+1056
Issue-ID: POLICY-1615 Change-Id: I3f7c6d754084d7c740876e817bf963a6cc8c194b Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
2019-04-08CLAMP Model policy creation supportuj426b2-915/+1167
Change-Id: Ia69f061c078e4f6ed4b4d2cd12f03f58514f2123 Issue-ID: POLICY-1416 Signed-off-by: uj426b <uj426b@att.com>
2019-04-04Auditing User Operations Push or Delete Policies.uj426b3-443/+474
Change-Id: I39d5fc01e68e9d711c5dd09790dc34beb68783c3 Issue-ID: POLICY-1421 Signed-off-by: uj426b <uj426b@att.com>
2019-03-31Enhancement to use the common CryptoUtilspa834y5-142/+164
Change-Id: I06718526382b424eab991f39a7dac1b5cf4f1b74 Issue-ID: POLICY-1422 Signed-off-by: pa834y <pa834y@att.com>
2019-03-29Merge "FIx Sonar Issues reported on ActionPolicyController"Jorge Hernandez4-247/+251
2019-03-29Merge "Fix Sonar Issues policy/engine POLICY-SDK-APP module"Jorge Hernandez9-465/+383
2019-03-28Merge "Fix sonar new bugs and vulnerabilities"Jorge Hernandez1-61/+82
2019-03-28FIx Sonar Issues reported on ActionPolicyControllerRashmi Pujar4-247/+251
- code cleanup, reduce cognitive complexity, extract constants etc Issue-ID: POLICY-1615 Change-Id: Ie0f634b1848076bba4c3ea3cbf9252b9faba0f8f Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
2019-03-28Fix Sonar Issues policy/engine POLICY-SDK-APP moduleRashmi Pujar9-465/+383
- Code cleanup & formatting, attempts to reduce cognitive complexity Issue-ID: POLICY-1615 Change-Id: I340fcaee185c1bc84d954863c413896120a51cb0 Signed-off-by: Rashmi Pujar <rashmi.pujar@bell.ca>
2019-03-27Fix sonar new bugs and vulnerabilitiespa834y1-61/+82
Change-Id: I7fbfe70e856d48f40ad831a6d0451e46024bf6de Issue-ID: POLICY-1417 Signed-off-by: pa834y <pa834y@att.com>
2019-03-27Merge "Model enhancement to support embedded JSON"Jorge Hernandez1-1379/+1536
2019-03-26Add capability for multi-role supportPolina Volodina5-897/+1198
Changes ported from ECOMP into ONAP for multi-role functionality in Policy Editor GUI Issue-ID: POLICY-1419 Change-Id: I438c074e935c28b014be44ae2eab1d49b45e11e2 Signed-off-by: Polina Volodina <pv789v@att.com>
2019-03-21Model enhancement to support embedded JSONuj426b1-1379/+1536
Change-Id: Ic7796d0800f320e9543b59a4eabf0570ca080f09 Issue-ID: POLICY-1420 Signed-off-by: uj426b <uj426b@att.com>
2019-01-22Merge "Improved snar issues"Pamela Dragosh1-4/+7
2019-01-21Improved snar issuesburdziak1-4/+7
Change-Id: Iaaf16a8e7e30174509cfb40702185c9b2fc2961a Issue-ID: POLICY-1432 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
2019-01-21Sonar issues improvedburdziak1-27/+33
Change-Id: I8b2ea531c1cfa6620a2240c3ae029c3c284f5cd7 Issue-ID: POLICY-1432 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
2019-01-17Small sonar issuesburdziak1-14/+17
Change-Id: Ifae0a81b6bfbbf08a68deb84b1514b88f2d19dea Issue-ID: POLICY-1432 Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
2018-11-07Fix issue with rendering 'identity' key in GUIMichael Mokry2-1/+9
Modified the java code to check dataOrderInfo format when getting data from model stored in the db table. Modified js code to check for type string when replacing 'equal-sign' with '=' in enum value list Change-Id: Iac804bc59da756f03073266703a684382d4afaff Issue-ID: POLICY-1243 Signed-off-by: Michael Mokry <michael.mokry@att.com> (cherry picked from commit 32d9ca08e62acee4239a2b02464bc332bebbaf32)
2018-09-18Merge "Added validation on matching required fields"Jorge Hernandez1-380/+712
2018-09-18Merge "AAF integration in Policy SDK"Pamela Dragosh2-1001/+1146
2018-09-17Added validation on matching required fieldsWang,Frank(gw1218)1-380/+712
Import policy should report to end users if there are missing required matching fields in policy template. Issue-ID: POLICY-1117 Change-Id: Iac4485259b73784e641f42a22d5a12c524f4b8e2 Signed-off-by: Wang,Frank(gw1218) <gw1218@att.com> Signed-off-by: Wang, Frank(gw1218) <gw1218@att.com>
2018-09-17AAF integration in Policy SDKrb71472-1001/+1146
Upgraded SDK version. Added SQL script with encrypt key. Added a function to save role on reading from session in PolicyController.java Addressed Check Style warnings in PolicyController.java Issue-ID: POLICY-1088 Change-Id: I446b6c1a0db2a989ad3f4e982e5cdba845f81045 Signed-off-by: rb7147 <rb7147@att.com>
2018-09-11New min/max Guard PolicyMichael Mokry1-1/+10
Made changes to support Guard policy create/update and other policy manager functions including deletePolicy and pushPolicy. Includes changes for new Guard policy support using GUI and API (Rest and Java Client) Made changes to address Jim's comments Made changes to address Liam's comments Change-Id: I133fe1fd9287ea77ea41a2788de90c7642c36b6a Issue-ID: POLICY-1038 Signed-off-by: Mike Mokry <mm117s@att.com>
2018-09-10Resolved XACML Platform Sonar issuesrb71471-26/+27
Issue-ID: POLICY-902 Change-Id: If22627dfe7df993b5c725ddf3a66c10ebbaa73ca Signed-off-by: rb7147 <rb7147@att.com>
2018-09-05XACML Platform Enhancementsrb71471-295/+356
To Support Raw Policy Creation from GUI and API. GetDecision on combining algorithim with Policy Set. Issue-ID: POLICY-902 Change-Id: Ie3189f8ded2e03366bc7d65d15b95b88c89b0acd Signed-off-by: rb7147 <rb7147@att.com>
2018-08-23Enhancement on DashboardWang,Frank(gw1218)1-362/+649
Enhancement on dashboard by including more info related to CRUD actions on policies and also providing an advanced search feature. Issue-ID: POLICY-1042 Change-Id: I987e0ca13824413f90299a366fb4464fca7de06a Signed-off-by: Wang,Frank(gw1218) <gw1218@att.com>
2018-08-14Resolved the Sonar issuesrb71471-25/+25
Issue-ID: POLICY-901 Change-Id: I30e1d075dd8eb4739bcb5aa1f2503a016900ff75 Signed-off-by: rb7147 <rb7147@att.com>
2018-08-06Modify Policy manager servlet for sonar issuesKrishnajinka1-103/+100
Fix basic sonar issues in policy manager servlet major and minor issues reported by sonar Basic refactoring Issue-ID: POLICY-1016 Change-Id: If3c19943c04d9af43807090b6340547d69ca6a19 Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
2018-08-03Fix major sonar issues in SDK APP admin modKrishnajinka3-479/+524
Fix Sonar reported major issues regarding extracting constants, method complexity, duplicated code blocks, more than 3 nested control blocks. Rework3 after self review. Issue-ID: POLICY-1016 Change-Id: Icbf940c966c51a8ef4319a94a3832cb1e8c360ba Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
2018-07-31Fix major sonar issues in SDK APPKrishnajinka2-666/+714
Fix major issues reported by sonar in POLICY SDK APP files such as CreateBRMSParamController, PolicyManagerServlet. Also modify tabs to space. Rework2 based on review comments Issue-ID: POLICY-1016 Change-Id: I5407ade1ce9f597fa91d9ca18506f5ac2d8b1411 Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
2018-07-26Merge "Fix issues reported by sonar"Liam Fallon5-709/+703