summaryrefslogtreecommitdiffstats
path: root/main/src/test/resources
AgeCommit message (Collapse)AuthorFilesLines
2023-10-11Remove AAF references from papadheli.tavares1-1/+0
Issue-ID: POLICY-4592 Change-Id: Id0d954f81e48d1464d71b37d853e74fc90b6fbeb Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-09-22Java 17 / Spring 6 / Spring Boot 3 Upgradeadheli.tavares2-105/+0
Issue-ID: POLICY-4671 Change-Id: I664e5f62b1ad23619888af98589c04875b07f4d3 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-08-08Removed db-based statistics featureSuresh Charan5-5/+0
Statistics code cleanup Issue-ID: POLICY-4109 Change-Id: I543080e1ed3ce9c4f16d01df8f13219cba0a9c8c Signed-off-by: Suresh Charan <suresh.charan@bell.ca>
2023-01-17Use generated PAP interface for Swaggerlapentafd2-1/+4
This commit removes the Swagger V2 annotations on the Rest Controllers in policy-pap. The OpeApi annotations (Swagger v3 annotations) are on a generated Java Interface. The code is changed so that the controller implements that interface. There are minimal code changes to the controller and the order of the parameters is switched in some cases. Issue-ID: POLICY-4404 Change-Id: I060709806a8e5bc04d9873c8d212a5c9fe13c4d4 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2022-12-18Upgrade the H2 database to the latest versionliamfallon2-1/+4
The latest verison of H2 does not allow colums called "user" or indexes using an underscore in their name. Issue-ID: POLICY-4488 Change-Id: I9ce7435b5dfa81daaf04e7f7a50f9db6582cdc0b Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-12-12SLAs for async methodsadheli.tavares1-0/+5
- undeploy policy timing - deploy policy timing - unit tests for actuator endpoints Issue-ID: POLICY-4469 Change-Id: I3298888e59824347b8d2a57fb531c10f2f4ca125 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2022-11-17Topic names in PAP should be configurable from application.yamladheli.tavares3-11/+105
- for using Kafka instead of dmaap, topics names need to be lowercase - fix for unit/integration tests using default names and changed names for topics and group - fix for sonar lints found along the way Issue-ID: POLICY-4455 Change-Id: I89e9e6f7dbb07462f1ae497755965cb5a3f223a3 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2022-03-01Fix swagger and improve exception handlinga.sreekumar1-0/+1
1) Swagger was getting generated in a different format due to a serialization isue. It is fixed. 2) Improved exception handling by taking care of any exceptions that could occur in and around database operations. 3) AAF enabling/disabling was done using spring profiles. This is changed to using parameters, as it is more easier to configure in an OOM helm chart deployment Change-Id: If1bee01379ba5c4efac29822662896d8aa883fc8 Issue-ID: POLICY-3975 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-02-23Add support for populating metadataSet in PAP tosca policyrameshiyer271-0/+20
MetadataSet fetched from the db and added to the policy metadata map with the key "metadataSet" before sending to PDPs Issue-ID: POLICY-3832 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I14064d82ba6877bd7560af7de7572b4813a98385
2022-02-17Use classes from policy/commonRam Krishna Verma1-1/+1
Use YamlHttpMessageConverter from policy/common. Use CustomImplicitNamingStrategy from policy/common. Fix few sonar issues. Issue-ID: POLICY-3931 Change-Id: I4720761cbf8da464ec57541f9b19f8d124503e17 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2022-02-10Add yaml support to pap api'sRam Krishna Verma1-0/+31
Adding yaml support to pap rest api's. Along with related unit tests. Issue-ID: POLICY-3864 Change-Id: I43bdbbd4151bcae5dcf4752a9385b115efa947d3 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2022-02-10Move PAP database provider to spring boot defaulta.sreekumar2-76/+0
This review makes PAP talk to DB directly using the spring repositories instead of going to policy-models-provider. The models-provider methods that were just used by PAP (and not used anymore) will be removed in a different review. Also a bug identified with the usage of GeneratedValue in PfGeneratedIdKey (which is just used by PAP in statistics & audit) will also be fixed in a separate review as part of POLICY-3897. CSIT changes: https://gerrit.onap.org/r/c/policy/docker/+/127033 WIP OOM review: https://gerrit.onap.org/r/c/oom/+/127035 Change-Id: Idb13ba7eb2767cc718672b582a6518fcfc95320f Issue-ID: POLICY-3867 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-01-28Create spring repository layer for PAPa.sreekumar3-25/+15
This review adds the spring repository and service layers to PAP. Once this is merged, the next work will be to actually use these spring boot based services to talk to the db directly, and not using policy-models-provider in PAP. Change-Id: Ib086b8b405020cb452e51d6359dd1a69d0000f74 Issue-ID: POLICY-3869 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-01-27Remove references to MariaDB from resource fileswaynedunican2-1/+66
Issue-ID: POLICY-2086 Change-Id: I891feb05d2e964ae8d4454d30672ffc77c1da555 Signed-off-by: Wayne Dunican <wayne.dunican@est.tech>
2022-01-07Adding totalPolicyDeployCounts updates to PapStasticsManagerisaac1-0/+25
Issue-ID: POLICY-3836 Signed-off-by: isaac <isaac.adorno@att.com> Change-Id: Ia4ed2595984f68bf75ca9dacb6aa76f04a306224
2021-12-14Migrate pap startup & controllers to spring boota.sreekumar1-0/+81
This commit migrates pap config, startup and controllers to spring boot. Change-Id: Icf91d728160a23db614dfba6b40ddccd2f6163a5 Issue-ID: POLICY-3754 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-11-03Rename username for PAP operations.adheli.tavares5-8/+8
Use an account other than healthcheck in PAP for provisioning of policies. Issue-ID: POLICY-2744 Change-Id: I897f7a4fffbac2d4bbd9cceb059bae1794753aa7 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-08-25Add dmaap connectivity check in papRam Krishna Verma2-0/+14
Add dmaap connectivity check in pap consolidated health check. Make a rest call to fetch all the topics. Verify POLICY-PDP-PAP topic is present. Issue-ID: POLICY-2896 Change-Id: Ide39c70999eaca61205225c95b904e3009d41408 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-07-06Use separate subscription for heartbeatsJim Hahn3-0/+21
Separated the heartbeat processing onto its own POLICY-HEARTBEAT topic, still on the "real" (i.e., "effective") POLICY-PDP-PAP topic, like we had originally been doing with the statistics. With this change, statistics processing continues to be part of the heartbeat class/processing, thus a separate class is not required to listen for, and handle, statistics. This new subscription uses a shared consumer group so that only one PAP will process any given heartbeat message, which should reduce the likelihood of DB contention and duplicate keys. This also means that the "saveStatisticsInDb" flag will still be used, which is a more obvious mechanism for controlling the storing of statistics than the presence/absence of a topic in the config file. Issue-ID: POLICY-3460 Change-Id: Ia07132b1c7aef006af86fddbe677fb1243a4e2c3 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-30Add ability to turn on/off pdp statisticsRam Krishna Verma3-0/+3
Adding an ability in pap to turn on/off processing of pdp statistics. By default it will be turned on and can be changed via configuration. Issue-ID: POLICY-3450 Change-Id: I093fe3f1390769f9acf2cfe85dd0d4edf0539de8 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-06-25PolicyAudit creation when deploy/undeploy triggered.adheli.tavares1-1/+2
Creates audits for policy when: - deploy - undeploy - undeploy when failure Issue-ID: POLICY-2899 Change-Id: Ib1a7cc4f826b5dceefcd5c7ba5250647f2cc0121 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-06-25Fix broken junitsJim Hahn1-1/+1
Some junits are broken since adding the expiration timer. Changed the length of the heartbeat in an attempt to fix it. Issue-ID: POLICY-3407 Change-Id: I81046476e243a0bf20ae9db9259be4464418e73e Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-23Remove expired PDPsJim Hahn4-46/+4
Added code to remove PDPs for which no message has been received for a while. Added a max-age field to the request-map parameters, changing the parameters class to use a Builder, in the process. Deleted the PdpTracker class, as its functionality was replaced by the expiration checker. Changed port numbers in some tests, due to collisions in junit tests. Issue-ID: POLICY-3407 Change-Id: Ifbfbc03b833a4f11ee5e910e256ee42e21a0afab Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-27support external configuration of pdp groupsjhh1-0/+36
- modify policy-pap.sh to optionally provision a custom group if such a file is present. Issue-ID: POLICY-3331 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ib53bc14ee6b9471ab48f5a792b4283db3ed53b93 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2021-03-29Validate parameters of REST callsJim Hahn5-0/+43
Added code to validate the parameters of the REST calls. As it turned out, validation only needed to be added to one call. Issue-ID: POLICY-2542 Change-Id: Ia9aabf75e06d6d5f996be9e3ed804218319f70c2 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-19Delete keystores from papJim Hahn1-0/+0
The Keystore is no longer needed in the tarball, as it is supplied externally by the CSITs and Helm charts. Deleted that file. Also modified the junits to use utils-test to generates keystores at runtime, thus deleted the junit keystore file, too. Issue-ID: POLICY-3143 Change-Id: I2b0c4868613e0923aad87844dd16f3ac236d4291 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-16Update policy-keystore with newer certificatesjhh1-0/+0
Issue-ID: POLICY-3139 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I728118f2eb691dddb93b36c832eb4c8a72e0d5af
2021-01-15Make PAP statelessJim Hahn2-51/+16
Removed old code that tracked the status using a cache. Modified the code to use the status found in the DB instead. Issue-ID: POLICY-2648 Change-Id: I4f1f5201eff7b3352631f50d67c40349ac7f2014 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-17Update persistence.xml with new TOSCA classesliamfallon1-6/+21
Issue-ID: POLICY-2900 Change-Id: I986074f69bef24ca894adc38eaf8b3ca4b4dc5a2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-10-06Remove legacy operational apex policy type from papRam Krishna Verma1-19/+27
The legacy operational policy type for apex has been removed in Guilin release. Removing it fron pdpGroup config in PAP. Issue-ID: POLICY-2857 Change-Id: Iddf2e6b6301dbab3addcbff4c806142f4cf8e6c6 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-09-24update default keystoresjhh1-0/+0
Issue-ID: POLICY-2827 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I95db673538947cccc39bb5a389ab3f544fa91af8
2020-08-07Fail component health check if PDP is downRam Krishna Verma1-0/+7
Changing the policy component health check to fail if the required PDP instances are down or not registered with PAP. The check is performed by comparing the "currentInstanceCount" & "desiredInstanceCount" fields of PdpSubGroup. Issue-ID: POLICY-2718 Change-Id: Iad1075d0812f4ef166dfed4f110eff4d9e5f995e Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-06-17PAP should discard old PDP messagesJim Hahn1-1/+2
Modified PAP to discard any messages old than 10 minutes so that if PAP is unable to communicate with DMaaP and then suddently gets flooded, it will discard old messages. Updates per review comments - made the "max message age" configurable, with a default of 10 minutes Issue-ID: POLICY-2170 Change-Id: I541c03aabf29482af12a07f51eeb5888bbafbf31 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-17renew policy certs till 03/17/2021jhh1-0/+0
Issue-ID: POLICY-2402 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I6386a6185089bfcc4358db2a0bdfe7a977b23992
2020-02-12Update PAP for policy DB response changesliamfallon1-1/+6
Policy models now throws an exception with a 404 code when policies are not found. This change amends PAP to cope with this change. Note: This change should be merged directly after the following policy-models patch: https://gerrit.onap.org/r/c/policy/models/+/101544 Issue-ID: POLICY-1402 Change-Id: Id38af4b2ad65797592c077e276861b962bc53ea2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-03Policy notifications appear to be reversedJim Hahn2-2/+9
Modified the code as follows: Until all PDPs have responded (or been removed), no notifications for their associated policies will be generated. However, once a response has been received for every PDP, then a notification is generated. For deployed policies, the notifications will continue to be generated as PDPs move back and forth between the success and failed states, as long as the policy is not undeployed. For undeployed policies, on the other hand, no additional notifications will be generated once all PDPs have successfully undeployed the policy. However, until that point, like with deployed policies, notifications will continue to be generated as PDPs move back and forth between the success and failed states. Added notification verifications in deploy and undeploy end-to-end tests. Issue-ID: POLICY-2347 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7d18dad1a7500e1efb7074e89ddaca4b1d368965
2020-01-10Merge "validate and save PdpStatistisc"Jim Hahn1-0/+2
2020-01-10validate and save PdpStatistiscHenry.Sun1-1/+5
Issue-ID: POLICY-2303 Change-Id: Ide10256556a20e2ab3977ab2cfd876dd82e44390 Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
2020-01-09statistics rest api updatening.xi1-0/+1
Issue-ID: POLICY-1629 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: I104fc448d27a282c01e7f54db300f918374b8d07
2020-01-09Changes related to persisiting data type of policy in dba.sreekumar1-1/+2
Change-Id: I09b373a511eaa20603d4d2de71a2a5a6bf652b3b Issue-ID: POLICY-2315 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-12-11consolidate Policy Health Check into PAPHengye4-4/+76
Issue-ID: POLICY-1689 Change-Id: I3b84094e217c8cda115efdbf3444e92f08013a7c Signed-off-by: Hengye <yehui.wang@est.tech>
2019-12-09Only update policies in PAP REST APIJim Hahn8-1/+249
Modified the deploy controller and provider to only update the policies within a group, while leaving the other fields unchanged. Added delta operations so that only additions or deletions need be included instead of providing the complete list of policies. Change-Id: Id2b69dac15f97b8a898f459f8d3f09216fc3618e Issue-ID: POLICY-2274 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-12-05Create PAP API to only create/update PdpGroupsa.sreekumar4-24/+52
Create an API to create/update PdpGroups. Policies are not allowed to be deployed as part of PDPGroup create/update operation. There will be a separate API as part of POLICY-2274 to deploy policies into individual group/subgroups. Change-Id: I4e2cb43fefe08b22d6f70a1db7c026e83f0ebde0 Issue-ID: POLICY-2273 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-11-22Re-register pdp if not found in DBramverma1-2/+7
During heartbeat processing, if the pdp instance is not found in the DB then registering the pdp again. So that it doesn't go out of sync. Added related test cases. Issue-ID: POLICY-2158 Change-Id: I557e2397536fd5b3a2783ec89d75ca0e43dcf9d0 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-11-21Adding pdpGroup to PdpRegistrationHandlerramverma1-0/+112
Adding pdpGroup as the matching condition for registration of Pdps. Removing the check of supported policy types in pdp heartbeat. Adding check of policies in pdp heartbeat. Adding comprehensive unit test coverage (98%) for the heartbeat listener. Issue-ID: POLICY-2231 Change-Id: I0fb961717c74656c5f1b6937b6c3a1410382a76e Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-11-06Support policy types with wild-cardsJim Hahn4-0/+101
Allow supported policy types to end with ".*", which causes the prefix to be matched when new policies are deployed. This entailed updates in three areas: - when a subgroup is added via the group api - when a subgroup is updated via the group api - when a policy is deployed via the simple api Issue-ID: POLICY-1636 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I4ae15971481ce5b2042b5d6fdfd16e11ad099c50 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-04Add REST api to query policy status from PAPJim Hahn1-0/+56
As part of this, added code to pre-load the deployed policy tracker by reading the policies and groups from the DB. Change-Id: Ifc6c787d114a3a7add4ea54acc1cc969d6c3ca1c Issue-ID: POLICY-2024 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-29Generate notifications when policies changejh73585-0/+65
Updated existing PAP code to make use of new notification classes. Change-Id: I4637ad92ac4f432f215cfc837e672c75074d88b5 Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-04Knock on of changing policy types to mapliamfallon1-161/+156
This review adapts policy-pap for the change in the structure of the toasca service template from a list of maps to a plain map. There is only a change to one test file. Issue-ID: POLICY-2047 Change-Id: Ieeeeb43d8f0300d075b3072b67f8d459def27ee7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-08-22update keystorejhh1-0/+0
Issue-ID: POLICY-1988 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I3e7d08621b6ac529f3517de8c2b910d2fa7c5151 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>