aboutsummaryrefslogtreecommitdiffstats
path: root/main/src
AgeCommit message (Collapse)AuthorFilesLines
2024-08-01Fix on persistence.xml after updating hibernate dependenciesHEADmasteradheli.tavares1-10/+8
- fix on side effects from drools-apps fix. Issue-ID: POLICY-4955 Change-Id: I6129924b891539ca67ac16627ca9d8e4f0775202 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-07-04Fix code smellsadheli.tavares2-11/+2
Issue-ID: POLICY-5067 Change-Id: I4172b9907fadb7fdc6099ce0c56d069b641f187e Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-07-03Code coverage and sonar fixesadheli.tavares28-1386/+1579
- added web mvc tests to cover controller exception cases - added webclient tests with full spring support to replace old style of Invoker - fixed some sonar issues - refactored a test still using @RunWith from junit4 Issue-ID: POLICY-5067 Change-Id: I4d3e77c32a603bdfeca4db76f00acf38830ef250 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2024-02-20Fix config files to remove outdated hibernate configurationadheli.tavares3-7/+2
Issue-ID: POLICY-4929 Change-Id: I218b6f0bc095d2693f8fa278a255dac0ad145588 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-11-27Allow semantic versioning in all templates in apiFrancescoFioraEst3-0/+278
Issue-ID: POLICY-4888 Change-Id: I824618039f49581cf82ea2ca570960b41cead6bd Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
2023-11-10Fix synchronization issues in policy-apiFrancescoFioraEst3-0/+57
Issue-ID: POLICY-4864 Change-Id: Ieed49019bee3dbd9e5c81dde341d18e6f4bac784 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
2023-10-11Removing AAF references from policy-apiadheli.tavares5-116/+2
Issue-ID: POLICY-4592 Change-Id: Ic8fbcb7ac58539fd91d7b077eedcb32b5c4e4a49 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-09-22Java 17 / Spring 6 / Spring Boot 3 Upgradeadheli.tavares37-487/+467
Issue-ID: POLICY-4670 Change-Id: Ie25d0501e5b936621e41f0d3c637320784d56627 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-08-08Removed db-based statistics featureSuresh Charan14-854/+11
Statistics code cleanup Issue-ID: POLICY-4109 Change-Id: I5ad893deaf365c7e289b57c00260672f127d2630 Signed-off-by: Suresh Charan <suresh.charan@bell.ca>
2023-02-09Fixed sonar issue in policy-apiSuresh Charan1-9/+14
Fixed cognitive complexity reported by sonar. Issue-ID: POLICY-4536 Change-Id: Ic3b5b7d79165afed15a1593e03b8374fb2122e12 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 dependenciesliamfallon4-14/+28
- 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-apilapentafd13-21/+460
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)lapentafd4-665/+144
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-12-12Use generated API interface for Swaggerliamfallon2-225/+37
This commit removes the Swagger V2 annotations on the NodeTemplateController 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. Issue-ID: POLICY-4404 Change-Id: Iab49c7f3f197a85d3314a879d39fe2c95be041b8 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-12-08Replace SpringFox with SpringDoc in policy-apiliamfallon2-39/+19
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: I5fb62e104c3a77e167a722a83f62dbddf2abedf1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-11-11Add OpenAPI Swagger 3 spc and API generationliamfallon1-0/+3379
This commit adds the Policy/API OpenAPI (Swagger) document as a source document under source control. This OpenAPI document was generated from the existing SpringFox annotations in the source code, was uploaded to the online Swagger editor and was converted into OpenAPI 3.0 format. It was then manually edited to correct the return types and to match the input and putput types to our Java classes. The pom.xml is also amended to generate the API interface source doe in the target/generated-sources directory. The generated code does NOT replace the existing API code as yet. Issue-ID: POLICY-4431 Change-Id: Idf3763fe99fc9dfa5739d9074213fa7d293fbba6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-08-17Preloading onap.policies.monitoring.tcagen2 2.0.0jhh2-5/+50
Issue-ID: POLICY-4317 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I8885ddbc942a40081583194e0ff03ff700b77975
2022-04-21Remove warnings in policy-api codeliamfallon3-7/+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-23Merge "Fix spring transaction issue in getNodetemplates"Liam Fallon1-2/+1
2022-03-22Fix spring transaction issue in getNodetemplatesrameshiyer271-2/+1
changes on the db service template object gets auto updated to the db by spring transaction. Creating new object copy to avoid the same. Issue-ID: POLICY-3934 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I0dbd5cb9d2c1119b2f263f60ed470bc8fef85d1e
2022-03-21API healthcheck must return healthcheck report objectRashmi Pujar4-13/+18
Retain previous behavior of returning the healthcheck report object for the healthcheck API upon DB failures. This is also needed for the enhanced readiness probe on policy components which uses the healthcheck endpoint. Issue-ID: POLICY-4030 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: Ifdbb23c8302567b4aa0f686bf9e77cdac37d1a62
2022-03-03Handle exceptions around DB transcations, data integrityRashmi Pujar11-37/+117
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 templatesrameshiyer2718-707/+659
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-28cleaner way to handle swagger serialization issueRashmi Pujar1-12/+11
Instaed of altering the springboot default http message converters, simply inject a GSON bean with a custom type adapter with springfox Json serializer. Issue-ID: POLICY-3753 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I0eb3b7cba538e7fd569f1cba9d540a7108db93e9
2022-02-24Migrate API DB provider to springboot data jpaRashmi Pujar9-84/+119
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 Pujar19-687/+1803
- 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-22Merge "Add REST Apis for Tosca Node template operations"Liam Fallon11-203/+2602
2022-02-21Add REST Apis for Tosca Node template operationsrameshiyer2711-203/+2602
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-16Use classes from policy/commonRam Krishna Verma2-114/+4
Use YamlHttpMessageConverter provided by policy/common. Fix few sonar issues. Issue-ID: POLICY-3931 Change-Id: I3c093df059f4ff70e3f99669c2bdea7d84cefcc6 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2022-02-10Migrate policy api startup & config, controller to springbootRashmi Pujar50-1971/+1095
Issue-ID: POLICY-3753 Signed-off-by: Rashmi Pujar <rashmi.pujar1@bell.ca> Change-Id: I4537ed49b7fc57683bfc487f0d212642b7e69f17
2022-01-19Remove references to MariaDB from resource fileswaynedunican3-3/+69
Issue-ID: POLICY-2086 Change-Id: I3c7d95863e1f46f5d0217bad6bd486de95e16b3a Signed-off-by: Wayne Dunican <wayne.dunican@est.tech>
2021-11-02Rename username for API operations.adheli.tavares6-7/+7
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-09-06Decrease eclipselink verbosity to warningjhh1-1/+1
Issue-ID: POLICY-3611 Change-Id: Iadb64d651a2d75f1a2912e56af55ab70d912f8d0 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2021-08-19Add check to verify api to db connectivityRam Krishna Verma1-3/+34
Adding a method in policy/api HealthCheckProvider to verify database connectivity. The same can then be reported in policy consolidated heath check done by PAP as well. Issue-ID: POLICY-2896 Change-Id: Id80ade57829b37ace15ae19caeefd08af61aebd5 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-08-17Update Policy Components not to create tablesktimoney1-12/+4
Issue-ID: POLICY-3488 Change-Id: I704e8b10db6fb8b5c3df13f255fc2076df03f1a2 Signed-off-by: ktimoney <kevin.timoney@est.tech>
2021-07-21Use singleton for api statisticsJim Hahn10-291/+180
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.sreekumar6-96/+23
Change-Id: I858b3bff44804f3bf0c04bd637fafa0c01af2e57 Issue-ID: POLICY-3392 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-06-18Fix new checkstyle issues in policy-apiJim Hahn1-2/+1
The new version of checkstyle identified new issues. Fixed those. Issue-ID: POLICY-3285 Change-Id: I47c7fe172d40ff5cd4b6309eeb1ed6ac5222240d Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in policy-apiJim Hahn8-39/+38
Fixed sonars: - use "var" instead of actual type name Issue-ID: POLICY-3285 Change-Id: I349e57f7abe84138f5aa3478e22652a593b59845 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-04-29Remove GroupValidationResultJim Hahn6-117/+47
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.tavares4-220/+41
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 Hahn2-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-16Update policy-keystore with newer certificatesjhh1-0/+0
Issue-ID: POLICY-3139 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I08670a96d0d37e5eb906eace95f15e2a4dfa0887
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 genericliamfallon4-30/+33
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-25add JpaPdpPolicyStatus to persistence.xmljhh2-1/+5
Issue-ID: POLICY-2648 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I3a71de299009e61f805d8c48a57a3c34a3f3ae76
2021-01-04Changed identifiers to concept identifiersliamfallon2-16/+14
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-12-17Update persistence.xml with new TOSCA classesliamfallon2-13/+42
Issue-ID: POLICY-2900 Change-Id: I3c83f7580a683c22dd1edc46da029851f28d9e0d Signed-off-by: liamfallon <liam.fallon@est.tech>