aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java
AgeCommit message (Collapse)AuthorFilesLines
2020-08-14Using standard success/failure messages in PAPa.sreekumar1-5/+4
Change-Id: If4613c0fc6f940bc82cf616aba2ba9cc03e1b599 Issue-ID: POLICY-2754 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-08-10Merge "Changes to make PAP container crash with non zero exitCode"Pamela Dragosh1-9/+15
2020-08-10Changes to make PAP container crash with non zero exitCodea.sreekumar1-9/+15
Make the application to return exitCode as 1 when the main process terminates due to issues such as: 1) Any basic issue in the startup config file causing error and terminates the main process, for e.g. a wrong name in parameterGroup. 2) Wrong info specified for database connectivity, say wrong username. This doesn't impact a case where database isn't ready yet and PAP container comes up first, such waiting is already handled by initContainer in the oom chart. PAP pod waits for policy-mariadb pod to be ready first, then only the main process is started and comes to this point. 3) An invalid port number is specified and the rest server is not able to start. These are the some of the scenarios which already makes the main process of PAP to terminate, and in these cases, an exception is thrown now which returns the exitCode as 1. Change-Id: Ie48726bcb36d7304eb60807fbaabbee8245e9c70 Issue-ID: POLICY-2754 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-08-07Fail component health check if PDP is downRam Krishna Verma2-1/+11
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-07-06Replace try/catch blocks with assertj - papwaynedunican1-34/+14
Replaced try/catch blocks in policy/pap test cases with assertj assertions Issue-ID: POLICY-2451 Change-Id: Ic963558e812b59d321e12fa87e7285732d6761e5 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-06-30Merge "Fix issues in pap for new sonar rules"Liam Fallon3-11/+15
2020-06-29Fix issues in pap for new sonar rulesJim Hahn3-11/+15
Addressed issues reported due to updates to the sonar rules: - invoke only one method in a junit lambda Issue-ID: POLICY-2679 Change-Id: I422856527b191a45b30a78bb8520f679ca2e7896 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-29Parallel execution of Client Health checkRam Krishna Verma1-13/+19
Issue-ID: POLICY-2390 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I42f443c64bcf6652adb9795ee8e71e37d8fa8c71
2020-06-19Changes for Checkstyle 8.32 in policy-papa.sreekumar5-7/+1
Change-Id: I995515659a4b7837bb15120f9c50fa0fd1f5434c Issue-ID: POLICY-2188 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-06-18pap - sonar issue fixTaka Cho2-4/+6
replace by assertNotSame Issue-ID: POLICY-2616 Change-Id: I927dbd8c57654cd2d2ef6262d13d63c79ba9035f Signed-off-by: Taka Cho <takamune.cho@att.com>
2020-06-17PAP should discard old PDP messagesJim Hahn2-4/+32
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-05-04Eliminate spurious notifications from PAPJim Hahn2-33/+8
Tracked it down to the following sequence: - policies were deployed to the pdp - received a request to undeploy a policy - generated a notification for the formerly deployed policy - this should not have been generated - undeployed the policy - received a response from the pdp indicating the policy had been undeployed - generated a notification indicating the policy was undeployed Removed the code that generated a notification when a policy is initially moved from deployed to undeployed (or vice versa). Issue-ID: POLICY-2539 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If175974b5fa5ccda6a1e1ab8fa1326b263bb8005
2020-04-29PAP should discard responses for old requestsJim Hahn1-1/+17
This is a more robust solution to the race condition previously identified with back-to-back deployment requests. The old fix has been rolled back and replaced with this fix. Issue-ID: POLICY-2527 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I2ea93f3a5eaac822abecf5d0745429b95712c861
2020-03-27Point to latest snapshotsPamela Dragosh1-1/+1
Issue-ID: POLICY-2378 Change-Id: Ica314e9facad9ac45351d708505b566e37c1e347 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-25Cleanup eclipse warningsPamela Dragosh3-21/+17
Issue-ID: POLICY-2271 Change-Id: Ib28a6f5321cc05b03994e180867461a631d40d75 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-28Add test cases for consolidated policy health checkhuaxing2-1/+277
Issue-ID: POLICY-1689 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: Ifda17a4486e1bce1ce0f523cc1984519b7fbc1aa
2020-02-10Cleanup the sonar issues in PAPa.sreekumar6-25/+39
Change-Id: I0eccc6064eb0b49d84370104d1219074ec8bde71 Issue-ID: POLICY-2271 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-02-03Policy notifications appear to be reversedJim Hahn5-40/+466
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-23Handling supported policy type during PdpGroup Updatea.sreekumar2-5/+7
Change-Id: I14daaa3d56d3293095227e0e3121e4fd82425b68 Issue-ID: POLICY-2023 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-14policy/pap jdk11 upgradesHOCKLA5-24/+24
Issue-ID: POLICY-1593 Change-Id: I61be9364d09b520e30aeac6d825b6c84574790ac Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-10Merge "validate and save PdpStatistisc"Jim Hahn2-2/+143
2020-01-10validate and save PdpStatistiscHenry.Sun2-2/+143
Issue-ID: POLICY-2303 Change-Id: Ide10256556a20e2ab3977ab2cfd876dd82e44390 Signed-off-by: Henry.Sun <henry.a.sun@est.tech>
2020-01-09statistics rest api updatening.xi2-1/+94
Issue-ID: POLICY-1629 Signed-off-by: ning.xi <ning.xi@est.tech> Change-Id: I104fc448d27a282c01e7f54db300f918374b8d07
2019-12-11consolidate Policy Health Check into PAPHengye2-1/+39
Issue-ID: POLICY-1689 Change-Id: I3b84094e217c8cda115efdbf3444e92f08013a7c Signed-off-by: Hengye <yehui.wang@est.tech>
2019-12-09Only update policies in PAP REST APIJim Hahn3-352/+322
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-158/+824
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-12-03Move deploy/undeploy REST classesJim Hahn9-12/+10
Moved classes from rest.depundep to rest, as they will no longer be specific to deploy/undeploy. Change-Id: Iea7c4e35fcd00ed83e678f7cd980e0aa9659f18e Issue-ID: POLICY-1866 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-22Update Pdp Group state per PAP APIJim Hahn1-0/+16
The PAP API can be used to update the state of a Pdp Group. However, the state wasn't being updated - fixed. Issue-ID: POLICY-2269 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I67fa3409424cfdb4b53b17e86f4cf354732d87e8
2019-11-22Re-register pdp if not found in DBramverma1-9/+49
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-21Merge "Undeploy policies when deploy fails"Jim Hahn6-3/+372
2019-11-21Adding pdpGroup to PdpRegistrationHandlerramverma2-26/+198
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-20Undeploy policies when deploy failsJim Hahn6-3/+372
Modified the code so that if a PDP fails to deploy one or more policies specified in a PDP-UPDATE message, PAP will undeploy those policies that failed to deploy to the PDP. This entails removing the policies from the Pdp Group(s), issuing new PDP-UPDATE requests, and updating the notification tracking data. Issue-ID: POLICY-2155 Change-Id: I1740282385b0fa804254ebdf57537ef0f3a7a4c8 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-07PAP should not deactivate PDPsJim Hahn1-56/+74
Modified the code so that it does not send a PASSIVE request to PDPs when they are fail, whether due to an inability to deploy a policy or due to a timeout. However, it still removes the PDP from the PDP Group, if a timeout occurs (but not due to a deployment failure). This review does not include any changes to undeploy failed policies; that will come in a later review. Issue-ID: POLICY-2155 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I15821d299bc3261478fd7fbb9ee62ea4a90123a4
2019-11-06Support policy types with wild-cardsJim Hahn1-2/+81
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-05Simplify request handling in PAPJim Hahn6-351/+178
PAP handles outgoing requests using a complicated priority queue. Simplified it significantly. Change-Id: I9f49dfebd7bf323c5e81bc8ca3459913fa95c43d Issue-ID: POLICY-2155 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-11-04Add REST api to query policy status from PAPJim Hahn6-18/+416
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-31Add tests for policy type in notificationsJim Hahn3-0/+10
The junit tests verified that the policy specified in the notifications, but did not verify the policy type. Added additional tests. Issue-ID: POLICY-2190 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Iad2a06163f9dce3dff3753cddef98db9e9ad2eea
2019-10-29Generate notifications when policies changejh735813-32/+275
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-10-25Add notifier for generating notificationsJim Hahn3-4/+218
Also modified the Publisher class to make it generic so that it could be used to publish PdpMessage AND PolicyNotification. Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I305de21a4ef84730f163af63446bafadab11a809
2019-10-24Add trackers for generating notificationsJim Hahn4-0/+629
Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7d6fe29707685e4711120b6a1e8448f25870a0ef Signed-off-by: Jim Hahn <jrh3@att.com>
2019-10-24Merge "Add PolicyPdpNotificationData for generating notifications"Jim Hahn1-0/+121
2019-10-23Add PolicyPdpNotificationData for generating notificationsJim Hahn1-0/+121
Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Icf5616190a8c3da38e2a1e33122b47a78e729d08
2019-10-23Add PolicyTrackerData for generating notificationsJim Hahn1-0/+239
Change-Id: Ife3ab77c0664101bbf32def5fb4d1a5ac194f459 Issue-ID: POLICY-1841 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-12Add yaml support to pap rest serverjrh31-0/+11
Change-Id: I3e3d5c46bfa4f1d093e64b8be9a9720570e6000c Issue-ID: POLICY-2085 Signed-off-by: jrh3 <jrh3@att.com>
2019-07-31Remove remaining ParameterUtils from PAPjrh31-4/+1
Issue-ID: POLICY-1953 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: I2bc56dfe2d5982d7dadb54311a94d6c6f95fa595
2019-07-30Use new addTopic(TopicParameterGroup) method in PAPjrh31-5/+1
Issue-ID: POLICY-1953 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: I225dc5f03d867efe6167fd20781c9959af34e0e9 Signed-off-by: jrh3 <jrh3@att.com>
2019-07-08Fix pap due to sonar changes in commonjrh35-19/+19
Fixed breakages due to changes made in policy/common to satisfy sonar. Issue-ID: POLICY-1791 Signed-off-by: jrh3 <jrh3@att.com> Change-Id: If8685462e1dd5cbbe58c329defff74ff2accf559
2019-07-01Remove topic.properties and incorporate into overall config filea.sreekumar5-26/+19
1) The properties in the topic.properties file is moved into overall config json file and the topic.properties file is removed. 2) Common parameters such as RestServer and Topic related parameters from policy-common is used. Change-Id: I390bbe3cda101a69e7ce614404ecdfbf98598dd2 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-06-26Use ToStringTester from utils-testramverma1-1/+1
Changing ToStringTester from utils to utils-test. Correcting the policy/common & policy/models version. Change-Id: Ib0a14da17227f0f65004dc525a47f17519e25110 Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-21Merge "Allow integer version when using PDP Group Deploy"Jorge Hernandez2-4/+60