aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org
AgeCommit message (Collapse)AuthorFilesLines
2023-02-02Replace Eclipselink with Hibernateliamfallon1-18/+28
Issue-ID: POLICY-4533 Change-Id: I8ba51dce05f537778a92547bceff6eb6d6099144 Signed-off-by: liamfallon <liam.fallon@est.tech>
2023-01-31Upgrade and clean up dependenciesliamfallon6-40/+34
- Upgrade Hibernate - Upgrade Mockito - Upgrade Mockserver - Remove Powermock (no longer supported) and replace with spring-test ReflectionTestUtils - Upgrade Spring Framework - Add spring-security to allow authentication on unit tests using MockMVC Minor clean-up - Replace deprecated authorization configuraiton on spring boot applications with SecurityFilterChain bean - Change @LocalPort include on tests to use test include rather than runtime include - Remove unused imports - Remove unused constants and variables - Add deprecation annotations where required Issue-ID: POLICY-4482 Change-Id: Ifcabd73e4130810ba2a99b842ffa4203836c0682 Signed-off-by: liamfallon <liam.fallon@est.tech>
2023-01-30Adding PAP contract testslapentafd1-0/+104
Adding Contract tests, verifying the stubbed implementation. Fixing name in application-stub.yaml Issue-ID: POLICY-4534 Change-Id: I03d8b37ba2f57aa03ee814924b4e52dd0c643772 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2023-01-25Server Stubs PAPlapentafd12-12/+12
Added "stub" profile with simple endpoint implementation Issue-ID: POLICY-4143 Change-Id: I8ad911f314e1d1428d05aa419f1322616d8ef835 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2023-01-17Use generated PAP interface for Swaggerlapentafd1-3/+3
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 versionliamfallon1-3/+0
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.tavares3-32/+116
- 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-12-08Replace SpringFox with SpringDoc in policy-papliamfallon5-5/+1
This commit: - Remove SpringFox - Adds SpringDoc - Enables the .../v3/api-docs endpoint Note that the Swagger annotations from the OpenAPI specification generated code need to be enabled so that the API specification is available over the ..../v3/api-docs endpoint. THis will be done in subsequent commits. Issue-ID: POLICY-4404 Change-Id: I42c1575a3ce76d9b3e753ad51f85df027d12b980 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-11-17Topic names in PAP should be configurable from application.yamladheli.tavares25-207/+231
- 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-09-21Fix minor warnings in codeliamfallon1-6/+3
Issue-ID: POLICY-4045 Change-Id: I08c3cb1af3dbe2051dcbb0e2726906faff4a37b3 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-04-12Fix incorrect deployments counter on parallel executiona.sreekumar3-2/+13
Change-Id: I72bde10eae615e2c89ccc1a211c6385404b9b3c7 Issue-ID: POLICY-4088 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-03-21Fix build failure in paprameshiyer271-1/+1
policy-models changes for metadataSet db serialization causes test failure in pap. Issue-ID: POLICY-3934 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: Ibc24e3a27e1cdd6111719651349888157fc31593
2022-03-10Fix PAP healthcheck response during failuresa.sreekumar1-2/+7
The healthcheck response that is returned by PAP is not inline with the actual healthreport. Even when the report has healthy:false, code:503, message:not alive the response code stays 200. This is fixed, this also makes the improved readiness probe in OOM to work properly with the healthcheck calls Change-Id: Ib208e0a84bce74157aacbcad61a11dcf900c7c94 Issue-ID: POLICY-4030 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-03-01Fix swagger and improve exception handlinga.sreekumar1-2/+2
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-25Merge "Add support for populating metadataSet in PAP tosca policy"Liam Fallon2-5/+139
2022-02-23Add support for populating metadataSet in PAP tosca policyrameshiyer272-5/+139
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-23Adding deployment metrics to PAPa.sreekumar6-2/+53
Change-Id: I4b6a93045c1ddfd7fff037e7568b029e2e45b0b3 Issue-ID: POLICY-3757 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-02-15Fix issue with GeneratedValue in PfGeneratedIdKeya.sreekumar1-4/+1
Change-Id: If244237e4aa39e1f3184cab04ae7d5ad7e85e5fa Issue-ID: POLICY-3897 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2022-02-14Merge "Add yaml support to pap api's"Ajith Sreekumar2-11/+38
2022-02-11Improve PAP healthcheck api to verify DB connectivityPrakhar Pandey1-2/+17
This commit improves PAP healthcheck API to enable verification of PAP to DB connectivity. Issue-ID: POLICY-3763 Signed-off-by: Prakhar Pandey <prakhar.pandey@bell.ca> Change-Id: I14353572a00e68a89161bcffd2ec3476b4a4c303
2022-02-10Add yaml support to pap api'sRam Krishna Verma2-11/+38
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.sreekumar31-1155/+1000
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.sreekumar5-0/+769
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-6/+47
Issue-ID: POLICY-2086 Change-Id: I891feb05d2e964ae8d4454d30672ffc77c1da555 Signed-off-by: Wayne Dunican <wayne.dunican@est.tech>
2022-01-07Adding totalPolicyDeployCounts updates to PapStasticsManagerisaac2-3/+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.sreekumar20-533/+130
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.tavares2-6/+6
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-09-02Fix PAP PDP expiration timerJim Hahn1-0/+12
Added runtime exceptions to the "catch" clause so that the thread associated with the PDP expiration timer will not terminate. Also added to a few other "catch" clauses, particularly those in the REST controllers. Issue-ID: POLICY-3625 Change-Id: I9206121d3e9b91da593ae771e7586752b13949be Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-25Add dmaap connectivity check in papRam Krishna Verma1-1/+35
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-08-23Fix junits broken by change in is-alive typeJim Hahn1-1/+3
Issue-ID: POLICY-3531 Change-Id: I1e66779f4ac05862649828e79914e902a99400d3 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-03Update query params in audit api'sRam Krishna Verma1-3/+3
Updating query params in audit api's to keep them in sync with statistics api's. Issue-ID: POLICY-3527 Change-Id: I096436930450c263835ff8852edd40655de4fb0d Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-07-30Add time ranges to PAP statistics APIJim Hahn1-27/+78
Issue-ID: POLICY-3511 Change-Id: Ifc91e4732b3574da37f55658b23faf8a9f8091f5 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-28Add datetime format to audit api'sRam Krishna Verma1-31/+89
Adding datetime format to audit api's so that clients can send the request in one common format. Changed the format to epoch timestamp. Fixed review comments. Issue-ID: POLICY-3340 Change-Id: I613ac02154a3e521ae97f7ac2e6129f642164b3f Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-07-22Add apis for policy auditRam Krishna Verma3-0/+319
Adding api's to fetch policy audit records from db. This is as per the design documented here - https://wiki.onap.org/display/DW/PAP+REST+API+changes+for+Istanbul+release Issue-ID: POLICY-3340 Change-Id: Iff80ab695d17ec38d4fe8ab98c0b95048cbae448 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-07-19Use new RestClientParameters class in PAPJim Hahn2-9/+9
Replaced generic BusTopicParams with more specific RestClientParameters. Issue-ID: POLICY-3456 Change-Id: Ic1a3acca5b651730fc74332c2c5d5bc36bccb790 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-07Update pdp statistics to count deploy/undeploy separately.adheli.tavares1-0/+2
Issue-ID: POLICY-3383 Change-Id: Iec7875fb1fa6a4a360b8cfdff0b80f697a289de3 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-07-06Fix NPE in UpdateReq.reconfigure()Jim Hahn1-0/+11
While running CSIT to test heartbeat changes with multiple PAPs, observed an NPE in UpdateReq.reconfigure(). Modified the code to always use deployment lists instead of null lists. Issue-ID: POLICY-3460 Change-Id: I884e091817e88309330139a01d060e286bd42008 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-05Revert "Add listener to collect PDP statistics"Jim Hahn1-235/+0
This reverts commit 7b4a8ec06c8266f368a31cdafe75cf8a59304c83. Reason for revert: Decided to have the whole heartbeat processing use its own subscription, thus no need for a new class/topic just to collect statistics. Issue-ID: POLICY-3405 Change-Id: I71580f877dae86a058ee881bc10f7bd1f57ff338 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-30Add listener to collect PDP statisticsJim Hahn1-0/+235
This new class will be tied into the existing code via the next review. Issue-ID: POLICY-3405 Change-Id: I4317ccba3eda6863ce96a6db4ef20816e59a7f2d Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-30Add ability to turn on/off pdp statisticsRam Krishna Verma1-3/+28
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-29Fix sonars in papJim Hahn1-2/+2
Fixed: - indentation - use isEmpty() - use isZero() Issue-ID: POLICY-3287 Change-Id: Idcfba3a6839a47c3136fca8500128990ed64dcb1 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-29Merge "Set "source" name in PAP PdpMessages"Jim Hahn3-16/+11
2021-06-29Merge "PolicyAudit creation when deploy/undeploy triggered."Jim Hahn7-100/+214
2021-06-29Set "source" name in PAP PdpMessagesJim Hahn3-16/+11
Used the unique name generator to initialize the PAP_NAME constant which is then stuffed into the various outgoing PdpMessages. Issue-ID: POLICY-3409 Change-Id: I45d26403b4f3de4b040cad779f29c82f35bacf42 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-25Send pdp-update if PDP response doesn't match DBJim Hahn3-12/+127
Because multiple PAPs can be updating the DB, it's possible that a pdp-update sent by a PAP does not reflect the latest deployment data in the DB. To solve that problem, modified code to compare any response received from a PDP with what's in the DB, potentially generating a new pdp-update (and/or pdp-state-change). Issue-ID: POLICY-3426 Change-Id: I241994330d7645c0fffe66abc33de67d71d77250 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-25PolicyAudit creation when deploy/undeploy triggered.adheli.tavares7-100/+214
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 Hahn7-416/+168
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-06-18Fix new checkstyle issues in papJim Hahn1-1/+0
The new version of checkstyle identified new issues. Fixed those. Issue-ID: POLICY-3287 Change-Id: I18a34cbc6197266375981031106acc38385c69b5 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-15Use new filtering methods in PAPJim Hahn1-1/+3
Modified PAP to use the new filter parameters classes instead of the old methods that take lots of parameters. Issue-ID: POLICY-3094 Change-Id: I46ac6d95a8f1e56ced8ed39474eb5a1031142dd7 Signed-off-by: Jim Hahn <jrh3@att.com>