aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org
AgeCommit message (Collapse)AuthorFilesLines
2023-08-08Removed db-based statistics featureSuresh Charan4-172/+2
Statistics code cleanup Issue-ID: POLICY-4109 Change-Id: I5ad893deaf365c7e289b57c00260672f127d2630 Signed-off-by: Suresh Charan <suresh.charan@bell.ca>
2023-02-01Contract Tests policy-apilapentafd2-92/+143
Adding Contract tests, verifying the stubbed implementation. Issue-ID: POLICY-4533 Change-Id: I729d0c2316b185967e0d7c292eb3c8c3da23ac23 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2023-01-31Upgrade and clean up dependenciesliamfallon3-6/+6
- 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: Id003bd0fecbdc7fe96a529cd6178a9a373d33963 Signed-off-by: liamfallon <liam.fallon@est.tech>
2023-01-18Adding Server stubs for policy-apilapentafd5-4/+96
Added server stubs for policy-api with profile "stub", with very simple implementation, and unit tests Added context-path in the application.yaml Issue-ID: POLICY-4143 Change-Id: Ibcf4cf2f6d3e6a87ac7eea365b387d75e19e96c0 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2022-12-21Use generated API interface for Swagger(2)lapentafd2-10/+26
This commit removes the Swagger V2 annotations on the ApiRestController in policy-api. 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 no code changes tot he controller except that the order of the parameters is switched in some cases. Adds unit test for SpingDoc swagger document generator endpoint. Issue-ID: POLICY-4404 Change-Id: Ic8976362481a0b49ad05cebb2f4f9ce4147f3965 Signed-off-by: lapentafd <francesco.lapenta@est.tech>
2022-04-21Remove warnings in policy-api codeliamfallon2-3/+1
Dependency versions are handled from managed dependencies in policy/parent Issue-ID: POLICY-4070 Change-Id: If4d86742e769b879d59bc839e44d63a355d20602 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-03-03Handle exceptions around DB transcations, data integrityRashmi Pujar3-2/+5
Issue-ID: POLICY-3976 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I9cdfff788d901824904bc74fdb7e2d482d28d562
2022-03-01Add spring repository and service layer for tosca node templatesrameshiyer274-6/+286
Removed policy, policyType providers along with models provider configurations. Issue-ID: POLICY-3923 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I696be6380758dbcc5b53cef635f3065eb0ce9a70
2022-02-24Migrate API DB provider to springboot data jpaRashmi Pujar1-1/+2
PolicyProviders and PolicyTypeProvider will be removed once the NodeTemplateController migration is complete. Issue-ID: POLICY-3924 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I01a7491c9a09d78a79a4c887f5a49024af648b8b
2022-02-23Spring repository and service layer for policy-apiRashmi Pujar8-687/+929
- Add the spring repository and service layers to policy-api. - Unit tests are modified to use the spring service layers Next-up: Migrate the usage of policy-models-provider in policy-api to spring boot based services to talk to database (POLICY-3924) Issue-ID: POLICY-3923 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: Ib6840040b32f24f019da802d3b246dab1bfccbe3
2022-02-21Add REST Apis for Tosca Node template operationsrameshiyer273-156/+462
Statistics handling for the new Apis are not added as it is going to be handled via spring actuators as part of spring migration.Please suggest if manual stats handling is required. Issue-ID: POLICY-3832 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I1eeaec9e617fd586238e7ff9e96d40a75c517885
2022-02-10Migrate policy api startup & config, controller to springbootRashmi Pujar12-865/+128
Issue-ID: POLICY-3753 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I4537ed49b7fc57683bfc487f0d212642b7e69f17
2022-01-19Remove references to MariaDB from resource fileswaynedunican1-1/+11
Issue-ID: POLICY-2086 Change-Id: I3c7d95863e1f46f5d0217bad6bd486de95e16b3a Signed-off-by: Wayne Dunican <wayne.dunican@est.tech>
2021-11-02Rename username for API operations.adheli.tavares1-1/+1
Use an account other than healthcheck in API for provisioning of policies. Issue-ID: POLICY-2744 Change-Id: If41467531152a73ecda2756886914ba0a4c6d9b4 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-07-21Use singleton for api statisticsJim Hahn5-74/+55
Reimplemented the statistics manager to use a singleton instead of static fields. Also changed some fields to "private". Issue-ID: POLICY-3392 Change-Id: Ic708f7fa29cba795c47d387764267016163f679f Signed-off-by: Jim Hahn <jrh3@att.com>
2021-07-19Use lombok annotations in policy-apia.sreekumar2-5/+6
Change-Id: I858b3bff44804f3bf0c04bd637fafa0c01af2e57 Issue-ID: POLICY-3392 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-04-29Remove GroupValidationResultJim Hahn3-67/+30
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Issue-ID: POLICY-2059 Change-Id: I774950e98c9421064bacf735e0f5a5ab18540570 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-04-16Refactor ApiCommandLineArguments classadheli.tavares2-29/+30
CMD Class to use CMD Handler from Common. Issue-ID: POLICY-3129 Change-Id: I7a1b960b1e3ecc6df0f7dde6b3301d640f4feb11 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2021-03-19Delete keystores from policy-apiJim Hahn1-6/+6
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: Ib3e2001f2dc41a528d1be2e81091a278cc31dff8 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-03-09Point to 2.4.1 modelsRam Krishna Verma1-1/+1
Issue-ID: POLICY-3127 Change-Id: Ib0cad9bba202428374281b29e1768975fcb09374 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-02-07Make filters on TOSCA entities genericliamfallon1-4/+4
The classes PolicyTypeFilter and PolicyFilter only work on Policy types and policies. However they just filter on name/version/type/typeversion so there is no reason that the filters could not be applied to other entities. This commit adapts the PolicyTypeFilter to EntityFilter and PolicyFilter to TypedEntityFilter, so the filters can be applied to collections of any ToscaEntity class. Issue-ID: POLICY-2995 Change-Id: Ibf12c757758d31ec3075119c56243e0abcf259bf Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-04Changed identifiers to concept identifiersliamfallon1-5/+4
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: I9ba3deae8eb4a8e51df5a40cdb8be8d9d23c5990 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-22Update unit tests for new validation messagesliamfallon3-150/+143
The refactoring work in validation caused some validation messages to change. This review adapts the API unit tests for those changes. Issue-ID: POLICY-2900 Change-Id: Ifcd1b61488321c7d1cffa7d4ca50d016ab9787c7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-09-16Remove base64 encoding of password from apiRam Krishna Verma3-6/+4
Remove base64 encoding of db password from policy-api component. Issue-ID: POLICY-2550 Change-Id: If395896f88f56f0284187f23d90ec5e0252ea17f Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-08-19Updates tests for new tcagen2 policy typePamela Dragosh3-21/+21
Forgot to include these. Once models got merged api failed. Issue-ID: POLICY-2772 Change-Id: Iae64effcba71ecbfbf6ab253de91842a9271c207 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-08-17Merge "Changes to make Policy-API container crash with non zero exitCode"Ram Krishna Verma1-7/+10
2020-08-14Remove legacy providers from apiRam Krishna Verma2-414/+1
Removed the legacy operational api's earlier but missed the provider. Removing provider and related tests now. Issue-ID: POLICY-2762 Change-Id: I902ad3939ba8b28b4ad182f666131a2c02cd98c4 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-08-14Changes to make Policy-API container crash with non zero exitCodea.sreekumar1-7/+10
Change-Id: I9e46aa87bfefbd56ef0077017293df34b654e36f Issue-ID: POLICY-2755 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2020-08-06Remove legacy operational policy from apiRam Krishna Verma1-201/+0
Issue-ID: POLICY-2762 Change-Id: I8e4b3cb5968a691dd9ac3ad9a42ccd7d9fc7b963 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-07-24Fetch and Delete policy API with PolicyName and PolicyVersionputhuparambil.aditya3-1/+220
Issue-ID: POLICY-2585 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: Icabde6463105ed382c1e32b6f7c1319490a385b2
2020-06-29Fix issues in api for new sonar rulesJim Hahn3-9/+9
Addressed issues reported due to updates to the sonar rules: - use assertEquals, assertNull, etc. - use "<>" - use "{}" place-holder Issue-ID: POLICY-2680 Change-Id: I42d5e635e09bac6e520fc7aa386814ad617fc1f6 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-19Changes for Checkstyle 8.32liamfallon8-10/+0
Issue-ID: POLICY-2188 Change-Id: I8765849462cd866f2a3049a5a4a02bce17330e66 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-06-15Removing duplicate yamls and jsonsaditya.puthuparambil1-70/+48
Issue-ID: POLICY-2052 Signed-off-by: aditya.puthuparambil <aditya.puthuparambil@est.tech> Change-Id: Ib4125baa1415cdc7f8a34fabc21fa322bc9b82a1
2020-05-10Policy DB contents removed on DB deadlockliamfallon2-47/+48
Unit test knock on from rework on Legacy policies. Issue-ID: POLICY-2548 Change-Id: I1f3469fb1f3e63da192614226b6ba456da7c1d4b Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-05-06Make type and type_version mandatory on policiesliamfallon2-5/+7
Up until now, the "type" and "type_version" fields defaulted to "NULL" and "0.0.0" respectively when they were not specified because the "type_version" field was not always specified on policies in previous releases. In cases where the "type_version" field was not specified, it was assumend that a "0.0.0" version of the policy type existed. In parallel, if the version field was not specified on the policy type, the version was stored as 0.0.0. This behaviour is now changed and the "type" and "type_version" fields are now always mandatory. Issue-ID: POLICY-2538 Change-Id: Ieec97f4a111edd13dbe31116c7549f07c19ef0aa Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-04-29Update SNDC Naming policy in APIJim Hahn1-5/+5
This fixes a broken junit test. Issue-ID: POLICY-2525 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: If5b97d168944471413149f4244d59c7d85ec7f0c
2020-04-22Skip policy preload if DB already contains dataJim Hahn1-0/+74
Issue-ID: POLICY-2517 Change-Id: I430eaed1dbc2f81aa2d15af0ced3e879349a8bea Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-30Add BARE and REFERENCED mode to policy fetchesliamfallon2-71/+102
In BARE mode (default), just the policy definitions are returned, in REFERENCED mode, the policy and all referenced policy and data types are returned. Issue-ID: POLICY-2377 Change-Id: Idc227d512d56945cc14dec0eae9264dbb3ca52a0 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-19Test change due to versions fix in Modelsliamfallon1-54/+52
Knock on change due to a change in error message returned by policy-models Issue-ID: POLICY-2377 Change-Id: I69702c52715b2c92c8bd87c8d34264f954b63891 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-06Removing legacy guard from policy/apiRam Krishna Verma2-571/+4
Renamed the guard policy types per this review: https://gerrit.onap.org/r/c/policy/models/+/103127 Issue-ID: POLICY-2243 Change-Id: I35ef95756483c869d374f36d0a1dfe6b588444c7 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-03Removing deployed from policy/apiRam Krishna Verma2-39/+0
The deployed API has already been created in PAP as part of Policy Update Notifications work. Removing the corresponding one from policy/api to make sure that all run time administration of PdpGroup and deployed policies are done only via PAP. Leaving the deployed API's in legacy controller as they will be removed together. Issue-ID: POLICY-1941 Change-Id: Ibe131f1aab3ec6a0eec05a2c91b5a140efc61b72 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2020-02-25Preload default policiesChenfei Gao6-32/+32
Issue-ID: POLICY-2317 Change-Id: I5794e617ea4fb99caf6e7a974a4886e72605979c Signed-off-by: Chenfei Gao <cgao@research.att.com>
2020-02-19Changes for cascaded get in policy modelsliamfallon2-8/+56
This review adapts policy API for changes introduced for cascaded returns on filtered gets in policy-models. Issue-ID: POLICY-1402 Change-Id: I7593eb64cc497809f8485f6add40b6a64291a060 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-18Add changes for safe delete in policy-modelsliamfallon5-38/+50
Issue-ID: POLICY-1402 Change-Id: I3f97fbb4c11105118857d354970d6a3de1385f2d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-17Updates to pulling Drools into own yamlPamela Dragosh4-7/+32
Also renamed legacy types and constants to ensure folks know legacy vs tosca compliant. Fixes recommended by Liam. Issue-ID: POLICY-2146 Change-Id: I744f589c0154138f8526e583d0f2b480f172c0c4 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-17Change return code checks in unit testsliamfallon1-4/+3
The return codes issued by TOSCA handling in policy-models have been changed to be more correct. This change updates the unit tests in API to use thw new codes. Issue-ID: POLICY-1402 Change-Id: If9798e5fe28bd3f92576135b8c5a34fc456a4925 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-13Update API for changes in TOSCA providerliamfallon5-294/+242
Knock on changes and some simplification of the code because the TOSCA provider now does some of the checks that were in API, so those checks are not needed in API any more. Various JUnit fixes. Issue-ID: POLICY-1402 Change-Id: Ic3a08e415c8cce4f2aad4b5da2623e41280c4e66 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-11junit failing after renaming recipe in op. policyjhh1-1/+1
Issue-ID: POLICY-2148 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ic24caab87a78899e2c0e044f328fdfbbae716235
2020-02-04Preloading Tosca compliant operational policy type for apex-pdpa.sreekumar1-6/+14
Change-Id: I544e275758945007b4d68d0a6b069f5963780178 Issue-ID: POLICY-2147 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-22tests for tosca compliant operational policiesjhh2-21/+123
Issue-ID: POLICY-2148 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I8c9ab43d75e3fb2bebdcb3a0a5bb16b46832b7ad