aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy
AgeCommit message (Collapse)AuthorFilesLines
2022-04-29Watchdog-process that changes CM Handles stateDylanB95EST5-6/+130
Add a fixed delay scheduler to switch cm-handles found in an ADVISED state to a READY state Scheduler currently runs every 30 seconds Will only update a single cm-handle at a time Queries CM-Handle with Advised States Only using CPS Path. Will choose cm handle at random Issue-ID: CPS-875 Change-Id: Ie1b49c89a0350d20e14748a65f9c1d260d8502d2 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-04-12Refactor existing model sync code into separate packagesourabh_sourabh3-31/+43
- Created a new class to seperate sync related operations of modules. - Kept newly created class into .../api/inventory/sync package. - Created a separate groovy test. - Fixed existing groovy test. Issue-ID: CPS-950 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ie7cc36ea75daf43f1383757bcf2057c5cb4894b1
2022-04-08Refactoring/ Adding Tests for ValidationDylanB95EST8-36/+98
Refactored classes affected by validation Have added tests for anywhere where validation is used Have refactored the parse and sync modules validation to be validated at the public api method Issue-ID: CPS-322 Change-Id: I4989cfd03300fbdca41571d0aa2d0b96978858ba Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-04-05Async: NCMP Rest impl. including Request ID generationsourabh_sourabh1-72/+10
- Restructured code and moved some of them at controller and service layer. - Unit is fixed and organized to it's belonging classes. Issue-ID: CPS-828 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I0919218e35b1d11cb579d707f376b76de80409da
2022-04-05[cps] Fix getResourceDataForPassthroughOperational endpointputhuparambil.aditya4-37/+19
Get endpoint only accepts application/json. Issue-ID: CPS-957 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: Ifc7426fbcd6073a39554014dc18b2107b6343b16
2022-04-05Merge "Structured Exception details for DMI"Bruno Sakoto1-15/+18
2022-04-04Structured Exception details for DMImpriyank1-15/+18
- Introduced DmiErrorMessage in API docs with 502 Bad Gateway - HttpClientRequestException will be thrown which will be exposed as 502 BAD Gateway for the client from NCMP Issue-ID: CPS-917 Change-Id: Iba8f159e8216bc1f63a9ab86208e5c802437e2e8 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-03-30Additional validation for names/identifiersDylanB95EST4-27/+39
Implementing additional regex validation for names/identifiers in CPS - Introduces a CpsValidator - Applies to relevent java public API's - Tests have been updated where necessary Issue-ID: CPS-322 Change-Id: I29ab8820bb1fe0eee247e425d6bb018bcd38f28e Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-03-27Registration Response for Create cmhandles operationsRenu Kumari1-105/+189
- Changed implementation to register each cm-handle at a time instead of registering all at once - Removed YangCMHandleList class and using String format to generated expected JSON - Response of all three operation types is returned in the updateDmiRegistrationAndSyncModule method - Changed parseAndRemoveCmHandlesInDmiRegistration to protected to keep in sync with create flow - Refactored existing create CMHandle test cases Issue-ID: CPS-896 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I5b0c01b3b8e31ca7c257b1e04069e35268be1132
2022-03-25Registration Response for Update and Delete cmhandles operationsRenu Kumari3-65/+153
- Process registration in the delete, create and update order - updateRegistration returns DMIRegistartionRespons that contains response for all operations - Added logic to not delete cmhandle if schemaset deletion fails Issue-ID: CPS-896 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I907ff678d478894e7d4d3cc24b23a979c02ed97a
2022-03-21Return Registration response for updating cmhandlesRenu Kumari2-6/+121
- Added CMHandleRegistrationResponse class for registration response - Send response in the case of success and failure - Each update operation in the request is independent on previous one Issue-ID: CPS-896 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Ic6cc69da48bd2078029784cabede4f5965054c03
2022-03-14Async: NCMP Rest impl. including Request ID generationsourabh_sourabh1-16/+17
- In case of invalid topic return http status 400 with error message - Unit test is modified to handle/validate InvalidTopicException Issue-ID: CPS-828 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I05645c92ccebb8aa422a47f6edcde7b64088a118
2022-03-11Merge "Async: NCMP Rest impl. including Request ID generation"Bruno Sakoto5-59/+242
2022-03-10Removed ExtendedModuleReference Objectsourabh_sourabh1-39/+0
-Introduced ModuleReference with 2 prop name and revision -Removed default constructor of ModuleReference Issue-ID: CPS-592 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I27a8a521f133c0773ef0aa0b9700ac42f6bc613b
2022-03-10Async: NCMP Rest impl. including Request ID generationsourabh_sourabh5-59/+242
- Based on topic api can be sync or async - RequestId is generated using UUID - Used UriComponentBuilder to populate dmi service url. - New test cases are introduced to validate service url generation. Issue-ID: CPS-828 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I2696d5cb012d9274b0c1265f16aa9b2369657f05
2022-03-01Create Endpoint For Get Cm Handles By NameDylanB95EST10-153/+187
Create endpoint and implement logic for get cm handle details by cm handle name Issue-ID: CPS-817 Change-Id: I83bd2da9219d13fac715a08b19108028ca6f6751 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-02-28NCMP Java API depends on NCM-Rest-API (cyclic) through json properties on ↵DylanB95EST1-12/+7
Java API Using POJO and new converter class instead of previous object mapper Issue-ID: CPS-893 Change-Id: I75531f386f08cb172d2901a4bbe97ae22cc5937e Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-02-28CPS-887 Decreasing performance of cmHandle registrationJosephKeenan1-7/+17
- Creating temporary table module references from the node - Query returning new moduleReferences for node to be added to CPS - Modified registration for node to use new implementation (incl. tests) - Refactored some interface to use collection instead of list - Modified SQL statements to use String.format() - Fixed tests Issue-ID: CPS-887 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: I58b17d29e8b9d6f7a644d33bf6cf8bf46f892580
2022-02-16Core logic to update,add or remove cmHandle propertiesmpriyank4-18/+172
Issue-ID: CPS-837 Change-Id: Ia078b6a0291ae916931259a309dd592b0554da28 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-02-02[TECHDEBT] Align CPS NCMP REST API SpecificationJosephKeenan2-9/+9
- Updated ncmp.yml to align implementation with specification - Added new Exception classes to differentiate between server NCMP issues and client based NCMP issues - Added 500 error to specification - To be merged after https://gerrit.onap.org/r/c/cps/+/126848 - Added excpetion handlers for SerNcmpException & DmiRequestException Issue-ID: CPS-823 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: If1c9c6c29c6ea2daa07753d7f766ef15c1ba4ca0
2022-01-28Support 'public' Cm Handle PropertiesDylanB95EST8-156/+167
Add support for new Public Additional Properties list to Register CM Handles API Issue-ID: CPS-677 Change-Id: I6efc88734da2416f72f71a403622e519398b502d Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2022-01-25Replace gson mapper with jackson mappersourabh_sourabh5-21/+42
We introduced JsonObjectMapper (wapper) as Spring component. Issue-ID: CPS-751 Change-Id: I536b0771a3a263325e6907717baf6941d70c0d6c Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-01-19[TECHDEBT] Remove deprecated API methods related to NCMPmpriyank3-79/+4
CpsQueryService instantiation removed as it was not in use. License Header updated for Nordix Foundation to 2021-2022. Issue-ID: CPS-642 Change-Id: I1aa204730f5d347d379cfdaaf0740323a317a559 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2021-12-15Adding unit tests and robuestness for DMI registrationJosephKeenan1-5/+9
-Added more scenarios for combinations of plugins -Made plugin registration more robust Issue-ID: CPS-736 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: I7495eb802fec8708e7ea6b0a97a9d7fe4676c8c1
2021-12-14Merge "Changing putOperationWithJson to postOperationWithJson"Toine Siebelink5-46/+109
2021-12-14Changing putOperationWithJson to postOperationWithJsonJosephKeenan5-46/+109
-Modified responseEntity<String> to reesponseEntity<Object> -Changed behaviour of sync to use new repsonses and removed JSON parsing -Updated tests to use new responsess -Tests have been updated and added jira to docs -Added messageConverters to RestTemplate to support plain text with ResponseEntity<Object> -Added docker log output for cps & dmi containers during CSIT teardown -Moved reponse conversion from service into DMIModelOperations class -Added response handling test (edgecases) -Updated response request body for passthrough-running CSIT test to pass Issue-ID: CPS-777 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: If2acf83a97b8aad5aa2c342154d807a47cace6a0
2021-12-14Add exception handling to delete schema set when a registration is removedniamhcore1-0/+13
Issue-ID: CPS-783 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: Ief4c6727e788822bc29379a757d25dff14f68c94
2021-12-08Delete anchor and schema set when a registration is removedniamhcore1-9/+15
Issue-ID: CPS-783 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I9644949e00c4de900b2609c1e70744ae5a243582
2021-12-08Support Delete operation for ds Passtrough-Running in NCMP 1/3DylanB95EST1-8/+8
Add delete operation for passthrough running within cps-ncmp. Issue-ID: CPS-638 Change-Id: I360672adc1f0f5c8eb351391c94f2d4fa913d0b4 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-12-07Undo manipulation of YangResource string as this is now handled correctly in ↵ToineSiebelink2-56/+5
DMI PLugin Issue-ID: CPS-788 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I7d308a62699709770f3629cbc55a26fb0e382010
2021-12-02Changing putOperationWithJson to postOperationWithJsonJosephKeenan2-11/+1
Issue-ID: CPS-736 Change-Id: I3fd2e0b6d6c20683b18f79ed78ed5c8990aee6d8 Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2021-11-25Allow separate registration of DMIDataPlugin and DmiModelPuginJosephKeenan9-482/+734
Moved relevant code from NetworkCmProxyDataServiceImp to DmiOperations Split DmiOperations into DMiData... and DMIModelOperations Merged update-operation changes Added tests for error message validation in NetworkCmProxyDataServiceImplSpec Removede @Service from DMIOperations and added @component to DmiDataOperations & DmiModelOperations Verify sync robot test is now hardened Added exitonfailure so robot tests stop after first encountered failed test Issue-ID: CPS-736 Change-Id: I0b40931cc8cd4fc0452328a0a7e0f60e6fc38d0a Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-11-10Update operation passthrough running - Service Layerniamhcore2-0/+38
Issue-ID: CPS-636 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I13334df383a23e59b3368b8664c10e086b1eb4a8
2021-11-02Add get cm handles by modules names - service layerniamhcore1-0/+7
Issue-ID: CPS-644 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: Ic2a57df02d533a0066382c12c35be8d524b6cdad
2021-11-02Clean Up Code around List NodesDylanB95EST1-10/+10
Make sure code refers clearly to List (whole) nodes or List elements incl. method names, parameter names, test descriptions etc. Issue-ID: CPS-756 Change-Id: Ic9dae6565c0e84c1ba4c2d6e891d3ea307f589da Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-10-12fix for sync and passthough usecasetragait2-32/+43
fixed unknown modules issue, if unknown modules are size 0 dmi should not be called. fixed 2xx issue for create resource. fixed options = null issue. Issue-ID: CPS-730 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: If6226f65e72753189c27648ad903c45a5d8fa14e
2021-10-08Merge "Update get yang resource response body"Toine Siebelink1-4/+16
2021-10-08Update get yang resource response bodyniamhcore1-4/+16
Issue-ID: CPS-706 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: Ic7045e873421ee5ce69e6e0400eeaa7a1d36eaf8
2021-10-07fix fields and depth to option querytragait2-26/+14
Issue-ID: CPS-678 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: I8934bd7708ae51dce77b8684081a71ca57bfa3a4
2021-10-06Changing resource identifier to a query paramniamhcore1-6/+6
*Update dmi operations to build dmi url using query param Issue-ID: CPS-679 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I2292507c5057837932f8e21f1a8e80721066b336
2021-09-27fix fetch modules request bodytragait1-18/+23
Issue-ID: CPS-653 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: I65bc9f10a9260e571810838fcbf4ed59ea1e2c30
2021-09-21Address Sonar Qube issuesToineSiebelink4-31/+80
- Add some basic test for missed coverage - Refactored NetworkCmProxyDataServiceImpl to addres duplcaied code and code coverage - Increased Coverage treshold where possible Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Id05f41ac242aeaf57606748009c0e370199e054f
2021-09-14Add test for missing code covereageToineSiebelink6-31/+200
- Add test for error scenarios and otehr mising tests - set up for SpringBean testing - some small typo fixes - fixed some SQ violations Issue-ID: CPS-656 Change-Id: If33f215c8ecaf090f27145005cc1aa7f0331d0f4 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2021-09-10CPS-635 - modified dataspace name for saving schema-set and anchorJosephKeenan1-4/+2
Issue-ID: CPS-635 Change-Id: Iaaaefd24ed9f13db7e1d76fd1295b44cc861b83f Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2021-09-10CPS-635 - Module Resource call does not include bodyJosephKeenan4-7/+65
Issue-ID: CPS-635 Change-Id: Ie7a783ec1cd5107cef19a128439532bb520e3e89 Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2021-09-08Address minor comments on tests for CPS-577DylanB95EST1-15/+14
Address comments left by Renu on NetworkCmProxyDataServiceImplSpec.groovy Issue-ID: CPS-597 Change-Id: Ieaa1756730640d7ef2d67eb8640c97f56e112e33 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-09-07P2 - Get module names and revisions rest layerniamhcore1-1/+1
Issue-ID: CPS-485 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I1bcf45902207d0dba6b5dfe8277cb06571694db3
2021-09-06P1 - Get module name and revision persistence layerniamhcore2-9/+9
Rename ModuleReference to ExtendedModuleReference Create new ModuleReference class (moduleName and revision) Update existing sync model flow to use new module reference class Create native query to get module name and revision Issue-ID: CPS-485 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I0d0da7742ceef3a68e83a5dd4852091e6adf138b
2021-09-02fix dmi base path in ncmptragait1-4/+4
Issue-ID: CPS-617 Signed-off-by: tragait <rahul.tyagi@est.tech> Change-Id: I3a0018c6054febfea5d9c4aa1c0e62f8aa1c160b
2021-08-30CPS-505 Retrieving modules for new CM handleJosephKeenan3-40/+131
-Added some production code for getting missing modules for new CM handle -Groovy test template added by Toine for getting msissing modules -Added json example for test -Modified test to check map contents -Differentiated restTemplate calls based on URL -Fixed code review comment`s -Groovy test now passing -Modified behaviour for sending moduleReferences and added null to namespace (jira to follow) -Combined NetworkCmProxyDataServiceImpl tests into one class & addressed code review comments Issue-ID: CPS-505 Change-Id: I91ef65467496caea7834ba2e8af99cfe58d4f880 Signed-off-by: JosephKeenan <joseph.keenan@est.tech>