aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org
AgeCommit message (Collapse)AuthorFilesLines
2019-10-18Modified Decision API to accept query parameters and abbreviate Monitor ↵HOCKLA2-0/+296
decision results Issue-ID: POLICY-2126 Change-Id: I18d50a8746ede792ec9507ab98125383c5914ba1 Signed-off-by: HOCKLA <ah999m@att.com>
2019-08-30Get policy type from policy-apiJim Hahn3-27/+92
Added a class to retrieve a policy type from the policy-api. Updated property files to include parameters that are needed to configure it. Updates per review comments: - change PolicyApi to PolicyApiCaller - use HttpClientFactory - removed superfluous constructors from exception classes - changed parameters to use RestServerParameters instead of BusTopicParams Change-Id: I8aad6ca5a733c8ad9cc983496e745ebe7400dd17 Issue-ID: POLICY-1911 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-23XACML junit spews dmaap errorsJim Hahn1-1/+1
Modified junit parameters to specify "noop" instead of "dmaap" in the topic properties, eliminating the dmaap error messages from the log. Change-Id: I350d988d10219e6ded2c011a4ed117fd5e71876a Issue-ID: POLICY-1725 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-30Use new addTopic() method in xacml-pdpJim Hahn1-6/+1
Replaced ParameterUtils with the use of the new addTopic(TopicParameterGroup) method. Change-Id: I35bf8a78d4670835dda005cdb218665a3bf48a16 Issue-ID: POLICY-1953 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-23Fixed xacml-pdp registrationJim Hahn1-23/+27
Apparently, TimerTasks may not be cancelled and then re-scheduled. Modified the code to use a scheduled thread pool instead. Change-Id: I2e26a5a37636f570f362481823a0274fe558e2e9 Issue-ID: POLICY-1939 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-23Add junit coverage to xacml-pdpJim Hahn6-0/+830
Change-Id: I9b59dcd27705e40c424b6a76420e0395adbe44bb Issue-ID: POLICY-1772 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-08Fix xacml-pdp due to sonar changes in commonJim Hahn1-3/+4
Fixed breakages due to changes made in policy/common to satisfy sonar. Change-Id: I6c655ca9509bc1d52277d55b02103e9875de2c29 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-04Remove topic.properties and incorporate into overall config file for xacmla.sreekumar6-44/+148
Change-Id: I3be6248db65041f5d9b7acfcf0fcd2f49d9d70f8 Issue-ID: POLICY-1744 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-07-01Use ToStringTester from utils-testramverma1-1/+1
Changing ToStringTester from utils to utils-test. Bumping the policy/common & policy/models version. Change-Id: Idf665bc92345c445f483ebfb190d39c7019280aa Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-19Update totalPoliciesCount statisticJim Hahn2-2/+12
Modified the code to set the policy count statistic at start-up and whenever the policy list is changed. Also fixed a couple of checkstyle issues in guard. Change-Id: I92017fe64cd5d19c36908347193cc21d183f051e Issue-ID: POLICY-1844 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-26Refactor xacml-pdp to remove various statics3.0.2-ONAPjh73586-364/+355
Refactored xacml-pdp to eliminate a number of static fields. Modified junit tests to allocate new ports for each test. Also modified XacmlPolicyUtilsTest to convert path names to match the file system so that the junit will work in OSs other than linux. Replaced logback.xml with a copy of the one from PAP to resolve some issues. Don't print entire message when discarding, as each PDP receives messages for ALL PDPs. Remove shutdown class from Main - just invoke this.shutdown() directly. Added additional comments to CommonRest. Also modified port test parameters. Change-Id: Id8bf7216cdcb59a1a2cb4cb957fa44f640315cfe Issue-ID: POLICY-1645 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Add statistics and sonar cleanup and blacklistPamela Dragosh5-37/+132
* Adding in the statistics for decisions and errors. * Cleaned up sonar issues and added code coverage. * Sped up JUnit tests * Fix JUnit issues with not finding application path * Fix TestDecision not finding persistence.xml * Fix for lingering statistics from previous runs. That needs to be addressed at a later time. * Changed persistence to use properties for configuration of database rather than hard coding the persistence.xml * Fix for Josh's comment to use else-if * Changed to use apache Pair * Added blacklist guard policy Issue-ID: POLICY-1440 Change-Id: I56af8c3dcc82463f7381f1eaea7f1440b76200bd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-10Test decision from main entryPamela Dragosh2-7/+55
Tests a decision upon startup. This also updates the use of ToscaPolicyTypeIdentifier for all the applications. Very basic packaging for applications and their properties. Added cleaning of unused imports to remove sonar issues. Added production persistence.xml file to guard application. Not sure if we need a copy in the application/common resource directory. Issue-ID: POLICY-1440 Change-Id: If96eef5a9e0a7c6cc5461c0bdb6f0cd708cc41bb Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-05Xacml PDP Register/Unregister ChangesMichael Mokry5-24/+64
1) Modified activator - Extend and use ServiceManagerContainer - add topicSink and topicSource properties to TopicEndpoint manager 2) Added PAP registration class 3) Added PDP message formatting class 4) Added PDP State Change listener to listen for state change and send back PDP Status.. then start heartbeat if not started already 5) Added Heartbeat publisher code to send heartbeat status on periodic interval 6) UPDATE: Made changes to satisfy Jim's review comments 7) Added code to XacmlPdpApplicationManager to get supportedPolicyTypes 8) UPDATE: more changes to satisfy Jim's latest review comments 9) Fixed the failed Junits causing build failure 10) Made change to use NetworkUtil for getting PdpStatus name value per Jorge's comment Still need to in separate review: 1) Write Junits for new code Registration and heartbeat flow as I understand it: 1) PDP starts and sends initial status to PAP with PASSIVE state 2) PDP listens for State Change from the PAP 3) PDP sends updated Active state to the AP 4) PDP begins sending periodic heartbeat status to the PAP Change-Id: Iafa06ae3f1ee195c7da3710a12d9c095c5413ec2 Issue-ID: POLICY-1449 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-04-04Tie XACML REST DecisionPamela Dragosh5-16/+235
Ties the decision API to the applications. Adds a static application manager class to manager the applications. Added applicationPath as a parameter to be supported in the Json parameter group. Issue-ID: POLICY-1440 Change-Id: I43cb44b3e308aadcf258fd987f3b53944c2edb72 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-18Started with test decision JSON objects.Pamela Dragosh1-1/+1
Added new Policy Finder Factory that ONAP will use and got the code working with new policy/models (see other review which will have to be merged first). Added some new conversion methods to convert from a Xacml request to an Onap request. Added some property methods for XACML Properties objects and JUnit tests. Started filling in some Guard application details and combining code. Issue-ID: POLICY-1602 Change-Id: I5235b74f3b036dcf05779b655a03ac290d594354 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-15Monitoring policy creation foundationPamela Dragosh4-1/+32
Upgrde to xacml v2.0.0 release artifact. Some re-arrangement of classes. New class to support a common dictionary among the monitoring applications. I may move it to a common under the main since some of the values are shareable. Created application service provider, so the XACML main knows what policy types are pre-loaded and can report them back to the PAP. struggled with cucumber, which does not create TemporaryFolder although the documentation says its supported. Added a new Policy Finder specific to ONAP which does quicker job to load policies. Issue-ID: POLICY-1273 Change-Id: I4af15a64da3b42d48f29809710421b1649625adc Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-11Added HTTPS and CADI/AAF Support for PDP-XMichael Mokry3-40/+182
- Yay I found the mysterious https issue that caused the junit to fail. Please don't laugh, it was a typo :) - Made changes per review comments 1) Added builder class for RestServer constructor 2) removed some try/catch blocks in junit 3) Other minor changes - More changes per review comments - Added changes per Ram's review comments (not lombrok yet) - Made changes for ONAP API CVS guidelines Change-Id: Ie1a6225459b3ce235cd73828ccddec04c690f5fd Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-26Stubbed endpoints for Decision API and swaggerMichael Mokry3-3/+6
Includes: 1) Decision API endpoint with Swagger annotations 2) Provider class for Decision added to new provider package 3) Moved other provider classes to provider package 4) Decision model class added to new model package Note: This is just a draft and still needs a lot of work, please do not merge. Thanks in advance for the review comments. Issue-ID: POLICY-1516 Change-Id: Id7414b6cb3eee1b877a0c11521babbef4938a68f Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-13Package and Create Docker Image for Xacml PDPMichael Mokry3-52/+72
- Creates docker image of policy xacml-pdp - Creates zip package of policy xacml-pdp - Also committed changes from Healthcheck/Statitics review that were allowed to be deferred Change-Id: Ia5fb72be05a30a341692453fe4ff32c7b112e861 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-11PDPX Healthcheck/Statistic RESTful API entry pointMichael Mokry8-0/+755
Includes: - Basic code structure modeled after policy distribution - Code implementation to support Healthcheck/Statistics RESTful API entry point - JUnits - Fixed Checkstyles issues and added some missing statistics classes and Junits - Made changes per Jim's comments - Made more changes per Jim's comments > made gson field static > using AssertThatThrownBy() mechanic from AssertJ > added setup and teardown to correctly terminate activator in Junit - Made corrections to the statitics endpoint and junits Change-Id: Iad40272beceff8a0f99966440e96a84fc2043b12 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>