summaryrefslogtreecommitdiffstats
path: root/main/src
AgeCommit message (Collapse)AuthorFilesLines
2020-01-02Speed up tests on policy-apiliamfallon10-2004/+1154
Test initialization and shutown of h2 database and REST server only done once at beginning of all API unit tests. Duplicate tests removed, all test done to persistent database and other minor improvements. We need to check coverage after this review, ti may have dropped by a few percent. We should design new tests to bring the coverage back up again. Issue-ID: POLICY-2297 Change-Id: I7ccb9835e01e08c284fdc4602e3a00e946b5e902 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-12-11Update preload optimization typesPamela Dragosh4-42/+46
The type names were updated and added 2 new types. Issue-ID: POLICY-2066 Change-Id: Ibbd149dec1809a9a815a5f6b64a8e7855fcc2010 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-12-06Merge "Preloading native policy type for apex-pdp"Pamela Dragosh5-49/+8
2019-12-06Preloading native policy type for apex-pdpramverma5-49/+8
Preloading native policy type for apex-pdp so that policies can be created and deployed using this policy type. Removed few test cases not working on windows. Issue-ID: POLICY-2279 Change-Id: I8e462118ee21e92fcb862ef94a6d15aec1b893c6 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-12-05Merge "change HealthCheckReport URL from self to hostName"Jim Hahn2-4/+6
2019-12-05change HealthCheckReport URL from self to hostNameHengye2-4/+6
Issue-ID: POLICY-1689 Consolidate Policy Health Check into PAP Change-Id: Ie7f8edf1d1a083c6c696824f249544959f72694d Signed-off-by: Hengye <yehui.wang@est.tech>
2019-12-02Fix sonar issues in policy-apiJim Hahn2-2/+2
The change to sonar cloud resulted in new issues being uncovered. Addressed two of the three issues with this: Remove this unused import... Add at least one assertion to this test case. The item left outstanding is: Make sure that command line arguments are used safely here. Issue-ID: POLICY-2206 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ie5dc339640102a5b4471e5b719338358ec3e0209 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-25Preload the policy types for native policiesChenfei Gao3-4/+10
Issue-ID: POLICY-2212, POLICY-2213 Change-Id: I03be8132699b5af9ea60a06cb0e1332c05886ad9 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-11-13Added changes to make the list of preloaded policy types configurableChenfei Gao15-56/+122
Issue-ID: POLICY-2210 Change-Id: I84b512a783c1fdc0834cf79bdce4c48a7803b884 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-11-01Preload the SDNC Naming Policy typePamela Dragosh1-1/+2
Needs to be available for policy creation. Issue-ID: POLICY-1740 Change-Id: Id473492ce1ba923131ec3505ecd8f27b18e30013 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-30Fix new eclipse warnings in policy-apiJim Hahn1-1/+0
Unused import. Issue-ID: POLICY-2206 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I1d443997a676d3833e60330c9a58a9715844efa2
2019-10-21Add missing Optimization base policy typePamela Dragosh1-0/+1
This should be there - it has "matchable" metadata needed by the XACML PDP optimization application. Issue-ID: POLICY-2066 Change-Id: Id20996f3cee1b45360e47731bc3d6a4f9457275d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-10-09Created a new simplified API for creating policiesChenfei Gao4-0/+198
Added a new endpoint to create multiple policies in one call Added corresponding provider method Added corresponding junit tests Issue-ID: POLICY-1991 Change-Id: I09202ededfd88cf9f1ac62ea036e98e3b5d78f98 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-09-16Add changes to support application/yaml in apiChenfei Gao7-527/+814
Issue-ID: POLICY-2101 Change-Id: I0860ff11231b6a649f52355d8d9333eec7d78826 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-09-05Knock on of changing policy types to mapliamfallon70-3763/+325
This review adapts policy-api for the change in the structure of the toasca service template from a list of maps to a plain map. DUplication of policy types and policies removed and policy-models examples used instead. Issue-ID: POLICY-2047 Change-Id: Ie1fdeef79289348005314c5de9b2e37c0c45d786 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-08-30Change scope to listPamela Dragosh1-1/+1
Missed this change in last review. Issue-ID: POLICY-1899 Change-Id: I19c9bd3346b9dd870ca3b62e7a5fb61b468e804b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-08-30Merge "Update optimization policy type"Jorge Hernandez11-287/+239
2019-08-30Update optimization policy typePamela Dragosh11-287/+239
Per work with Optimization team, identifying common attributes for matchable optimization policies. Fixed TOSCA syntax errors - use map instead of list. Removed identity from PciPolicy, QueryPolicy and OptimizationPolicy. Added example of how vCPE policies now look. Updated the example for HPA Policy based on Ruoyo input. Fixed syntax errors due to JSON conversion. Trailing spaces. Added back in list for applicableResources and required scope attribute for example policies. Issue-ID: POLICY-1899 Change-Id: Ic8ae6db0575fb21fca6103ab2ed015c8524def80 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-08-28Preload control loop coordination type in APIJim Hahn6-4/+43
Modified json based on input from Chenfei. Change-Id: Ibd70c5737713fee5dcd2370e02ef5f567d2a73b3 Issue-ID: POLICY-1847 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-22update keystorejhh1-0/+0
Issue-ID: POLICY-1988 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ia3878cad1ec0eb22b21b09531ed99d33c4d104f2 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-08-16Adding more policy-api junitsBilal A1-1/+296
Issue-ID: POLICY-1771 Signed-off-by: Bilal A <bilal@research.att.com> Change-Id: If85abb8280e28da7391bb4b4cb502473a404065b
2019-08-08Add get deployed endpoints for legacy policiesChenfei Gao11-120/+622
Issue-ID: POLICY-1810 Change-Id: I47046fbbd7d319b58cabf57ff470ec0d5246c88a Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-08-01Policy API Junit testsBilal A1-0/+51
Issue-ID: POLICY-1771 Signed-off-by: Bilal A <bilal@research.att.com> Change-Id: I8ee41b6df32a97cebdc4e07782e564698d10154b
2019-07-31Policy API JUnit TestsBilal A4-15/+205
1) Adds tests for testing LegacyGuardPolicyProvider and LegacyOperationalPolicyProvider 2) Fixes issue in LegacyGuardPolicyProvider and LegacyOperationalPolicyProvider to handle policy version number properly while deleting policies. Issue-ID: POLICY-1771 Signed-off-by: Bilal A <bilal@research.att.com> Change-Id: I01d48b5352e7e6da403faf1e4997d3550024755f
2019-07-29Policy API more JUnit TestsBilal A3-6/+283
Issue-ID: POLICY-1771 Signed-off-by: Bilal A <bilal@research.att.com> Change-Id: I8882d9aa6e1e56e9425224b9fdfba01552b5e993
2019-07-18Modify policy/api to use RestServer from commonJim Hahn11-412/+46
This also entailed removing the local copy of RestServerParameters. Change-Id: Ie5c581ab70aee60844d1660fe0a61290de6470ec Issue-ID: POLICY-1652 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-16Adding unit tests for Policy API.Bilal A4-0/+143
Issue-ID: POLICY-1771 Signed-off-by: Bilal A <bilal@research.att.com> Change-Id: I8ea0729ca029c15edcb7564fa35c8811976ca6a8
2019-07-11Fix sonar issues in policy-apiJim Hahn8-521/+397
Extracted some methods to address cyclomatic complexity. Created super classes to address duplicate code. Did not address code coverage. Change-Id: I2ec07cdad9e671b0e239e2d4ae9395e89b9e4266 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-08Fix api due to sonar changes in commonJim Hahn6-35/+76
Fixed breakages due to changes made in policy/common to satisfy sonar. Also modified the code to allocate ports for junit tests, writing them into the config files. Change-Id: Id31d19e0691f7450c3e4158090dac6f3c3849631 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-26Use ToStringTester from utils-testramverma1-2/+1
Changing ToStringTester from utils to utils-test. Correcting the policy/common & policy/models version. Change-Id: I33a590367732ff315a9b03aca917e4be5f1ae05e Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-18Fix the bug of cannot return multiple versions of tosca entityChenfei Gao1-1/+1
Issue-ID: POLICY-1807 Change-Id: I143f3228fd5e23365c95ee13f2e639f9862fc33e Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-06-18Merge "added file to test RestServerParameters.java"Liam Fallon1-0/+46
2019-06-18Merge "Change getCanonicalName() to getName() in api"Liam Fallon3-15/+10
2019-06-17Change getCanonicalName() to getName() in apiJim Hahn3-15/+10
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: Ia1726f178f906bfdfbd056c50598228cff8e1a2d Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13added file to test ApiStatisticsManager.javaSandeep J1-0/+45
to increase code coverage Issue-ID: POLICY-1791 Change-Id: Ie0a5027ad61224c44b30127348c4a81454549fc9 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
2019-06-13added file to test RestServerParameters.javaSandeep J1-0/+46
to increase code coverage Issue-ID: POLICY-1791 Change-Id: I9d6632d995b4dfd014b51467a66b95d042d6113c Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
2019-05-23Log POST requestsJim Hahn2-0/+76
Add logging of POST requests received via the REST API. Change-Id: I8c71df3a45b8a3369b48eee06165dd5034c115a6 Issue-ID: POLICY-1777 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-22Reserve version integer check and delete eligibility checkChenfei Gao4-4/+4
Per Jim's comment, version integer check should come first before checking delete elibibility (i.e. checking if policy is deployed in PDP group or not). Issue-ID: POLICY-1777 Change-Id: Ibd3d8d05a40ef34c558a2e9389596396a69469fe Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-21Modify legacy API and policy provider to support version enabled features in ↵Chenfei Gao9-88/+244
legacy db provider Includes: a) Modify legacy API endpoints to retrieve the latest version of legacy policies b) Modify legacy policy providers to support newly added version enabled features in db provider c) Fix corresponding junit test failures Issue-ID: POLICY-1777 Change-Id: I641170b37e2929b5060414832d4b8395493cecdc Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-10Add more filtering conditions to filter returned PdpGroups with specified ↵Chenfei Gao1-1/+3
policy deployed Add groupState=ACTIVE and pdpState=ACTIVE to pdpGroupFilter for filtering returned pdpGroup list with specified policy deployed in it. Issue-ID: POLICY-1738 Change-Id: Ie777ab1f6438871b2034c8f2fe7a61595a3f633c Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-07Preload legacy operational policy type and guard policy typesChenfei Gao14-8/+382
Includes: a) Add legacy operational policy type and guard policy types into preloading list. b) Fix corresponding junit test failure. Issue-ID: POLICY-1738 Change-Id: I071e898be31e62f47d427094f1e76069fafd0148 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-02Fix api sonar bugs - logging exceptionsChenfei Gao2-0/+40
Fix api sonar bugs by logging exceptions in api controllers Issue-ID: POLICY-1710 Change-Id: Ie591e0d4709c43f3e91aa7b94a1305d8814bd695 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-01Add version to preloaded policy typesJim Hahn10-10/+20
Change-Id: Iee60e74742dce9df03b5409356dcf2cb433c811c Issue-ID: POLICY-1724 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-26Fix legacy policy type names3.0.2-ONAPPamela Dragosh2-20/+20
The default names were incorrect in the api path. Issue-ID: POLICY-1704 Change-Id: Ib95a7954c6b4a6fef0e871dfd4130e600e03c957 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-16Preload policy types when api starts upChenfei Gao18-4/+1443
Includes: a) Preload monitoring and optimization policy types when api component starts up b) Fix the failure unit testing delete policy type c) Enhance several junit test cases to be irrespective of running orders Issue-ID: POLICY-1441 Change-Id: Ia1ba17d58dfbc9a8ee12e789e3867b20111e9cd2 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-11Add junit tests for endpointsChenfei Gao18-136/+690
Add junit tests to improve code coverage to > 80%. Modify db setting and remove db authorization from persistence. Issue-ID: POLICY-1441 Change-Id: I6070ac9ba6adba836adeeb547610c27dccf577bd Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-10Modify delete safety net and DB lab setupChenfei Gao14-566/+953
Includes: a) Close db connection using try-with-resource b) Modify delete safety net for policy, policy type and legacy policies c) Modify db persistence d) Modify db setup in bootstrap config e) Add unit tests for providers and endpoints Issue-ID: POLICY-1441 Change-Id: Id89bc361c73380df61df35f01f296e47e936e9cf Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-09Modify policy provider to support GET/CREATEChenfei Gao15-58/+863
Modify policy and policy type providers to better support GET/CREATE policy/policy types. Issue-ID: POLICY-1442 Change-Id: I7a513be4f9dbd5b48b85a948e3bda7b6c6ab7ddb Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-05Incorporate filters in provider functionsChenfei Gao10-65/+398
Use filters to GET wildcard/latest/deployed policies and policy types. Junit tests for providers are coming in next patch/review. Issue-ID: POLICY-1441 Change-Id: Iccd02f395d612ba95728d1bc5808ad16c6f386fe Signed-off-by: Chenfei Gao <cgao@research.att.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-03Implement policy provider functionsChenfei Gao28-435/+1395
Includes: a) Implement policy provider functions b) Implement policy type provider functions c) Implement legacy guard policy provider functions d) Implement legacy operational policy provider functions e) Modify API endpoints to align with provider functions f) Hook up API statistics counter Junit tests for providers and new endpoints will be in next patch/review. Issue-ID: POLICY-1441 Change-Id: I113de95f6e0ea5f5436c072536f5e9a178988e5e Signed-off-by: Chenfei Gao <cgao@research.att.com>