aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
AgeCommit message (Collapse)AuthorFilesLines
2022-07-05Coverage for NotificationErrorHandleremaclee1-0/+41
Issue-ID: CPS-475 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Iadcb89c83aaa72afa0839d53a31799316c5966c5
2022-06-30Composite state transition code changesourabh_sourabh1-2/+5
- Code cannge to set datastore to Unsynchronized when state moves from advice to ready - if resource data is not available or there is any issue while reading data from simulator then state will be set to synchronized else remain unsynchronized. - Handle serialization failure on empty bean. Issue-ID: CPS-1000 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ie51a787770da649e00aaefc00341756f92f9fa83
2022-06-30Add method to get YANG module sources for CM handleemaclee1-1/+7
- part of this commit includes renaming the enum SyncState to DataStoreSyncState Issue-ID: CPS-1064 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I6bf419141a1b33f09871946445cdfff422c8c354
2022-06-30Kafka consumer can not be turned offJosephKeenan1-2/+1
-NOTE: Build will fail until docker-compose version issues on build server are fixed --Ticket raised https://jira.linuxfoundation.org/plugins/servlet/theme/portal/2/IT-24219 -added flag for async -added response if async is triggered without being enabled & associated test -modified to use one global flag for notifications Issue-ID: CPS-1088 Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Change-Id: If9d988b4dcb71bf37c1b1bf9464090782708ffc2
2022-06-22Data Sync Watchdog Processsourabh_sourabh1-0/+18
- Get all the Cm Handles state in READY and Operational datastores sync state in UNSYNCHRONIZED - Get a random Cm Handle - Get the first resource data from the node - Save the data in Cps Db - Update the Operational datastores sync state to SYNCHRONIZED Issue-ID: CPS-1052 Issue-ID: CPS-1053 Issue-ID: CPS-1054 Change-Id: I9a20391ef30e6d56c4d789a92b8bf42cd3756c62 Signed-off-by: Lathish <lathishbabu.ganesan@est.tech> Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-06-13Fix sonar code smellskissand2-5/+4
- https://sonarcloud.io/project/issues?resolved=false&types=CODE_SMELL&id=onap_cps&open=AYFC3OguDZ5Vb3SQMOU1 Issue-ID: CPS-1016 Change-Id: Ic8fdae78337da1ff2c239ae2dfae67e23e88a4bb Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-06-08Merge 2 'query' end points in NCMPkissand2-10/+91
- merge two endpoint for a same backend - use xPath query instead of sql query - modify searches endpoint to return a cmHandle object with all public properties - handle old (deprecated) queries - handle public property queries - create useful examples - use more verbose error messages - simplify openapi yamls - create new query service - change second endpoint name to a better matched name - modify legacy tests with new requirements - create new tests for the new scenarios Issue-ID: CPS-1016 Change-Id: I7476e9dbd510ec93b5b48ce85d477ecb2dadffff Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-06-02Merge "Add module name to cps core output"Toine Siebelink2-8/+37
2022-06-02Add module name to cps core outputemaclee2-8/+37
- add withModuleName method - add getNodeIdentifierWithPrefix method - add unit test in DataMapUtilsSpec - add unit test in DataNodeBuilderSpec - fix all existing unit tests Issue-ID: CPS-870 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I51b70fa2dd3381eef9500b4339d4922c017e3000
2022-05-25Async request response NCMP -> ClientJosephKeenan3-14/+14
-Added consumer for DMI events and producer for forwarding to client -Added schemas for events -Updated tests -Added new module for ncmp events -Used mapstruct for event mapping Issue-ID: CPS-830 Change-Id: I096d08af9d69092cf8651e11eaa00ce441fc3605 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2022-05-03Fix sonar code smellskissand1-2/+17
* Increase code coverage in DataNodeBuilder Issue-ID: CPS-475 Change-Id: I00a3b1c81911c1ccd3db810eec2f2989946809c5 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-04-29Merge "Fix sonar code smells"Toine Siebelink1-5/+7
2022-04-29Fix sonar code smellskissand1-5/+7
* Increase code coverage https://sonarcloud.io/component_measures?metric=uncovered_conditions&id=onap_cps Issue-ID: CPS-475 Change-Id: I124bad6c01acbcb9658f52eb68079628e074168e Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-04-27Add methods to Lock Anchor entityemaclee1-0/+17
Added separate integration and mock-based unit tests Issue-ID: CPS-898 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: I14d1d1c41759ce028e2417fdd2df001280e19ab2
2022-04-08Refactoring/ Adding Tests for ValidationDylanB95EST5-1/+399
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-06Query based on Public CM PropertiesJosephKeenan1-1/+11
-Updated OpenAPI for new Endpoint -Will replace SQL with CPSPathQuery once investigation is complete -Functionality in place to determine if public properties match - -Added Unit and CSIT tests - small modifications may need to be made -CSIT tests enhanced to add additional nodes and tests Issue-ID: CPS-731 Change-Id: I403e603ce79c4a4a6994d51b459b5703510d5a83 Signed-off-by: DylanB95EST <dylan.byrne@est.tech> Signed-off-by: JosephKeenan <joseph.keenan@est.tech>
2022-04-05Async: NCMP Rest impl. including Request ID generationsourabh_sourabh1-0/+14
- 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-03-30Additional validation for names/identifiersDylanB95EST3-5/+53
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-25Add Start and Stop sessions on JAVA APIemaclee1-0/+16
Issue-ID: CPS-899 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Idbeb922790824b1ca601d6d4798df45efa57d685
2022-03-10Removed ExtendedModuleReference Objectsourabh_sourabh1-4/+3
-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-03Bug fix for delete data node not working for root nodeputhuparambil.aditya1-27/+17
Fixing event for deletion of container node Fixing event for deletion of root node when '' is passed as xpath Issue-ID: CPS-895 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I0676aec29e7b7e12bef2300219207ddc22414daa
2022-02-28CPS-887 Decreasing performance of cmHandle registrationJosephKeenan1-12/+20
- 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-17Align JSON DataNode for Get and Post/Put API in CPSputhuparambil.aditya2-8/+28
Issue-ID: CPS-865 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I60b1f9c94e79bdd66d60fe6a68f5fc4adc718d35
2022-02-15Fix to keep yang resource cache in syncRenu Kumari2-32/+144
- Removed schemaset from cache when schemaset is deleted - Added separate test cases for yang resource cache Issue-ID: CPS-864 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Ie1f9978406de1c92b513549216873cba4a98cdd7
2022-02-14Improve logging in NCMPsourabh_sourabh1-13/+20
- Code to change to apply logs at runtime - Fix for minor code smell Issue-ID: CPS-855 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I93a556fe0fb7ca05a42e84eb5ec4f84afaa8fd92
2022-02-07Add support for delete data-node eventRenu Kumari3-45/+70
- Changed process event input to address delete - Send null data in the event if the operation is DELETE Issue-ID: CPS-791 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: If851f7132e94bcbcaf4324d07a2a00c90d1882b7
2022-02-02Refactor Delete Anchor functionalityRenu Kumari3-22/+20
- Added a delete DataNode functionality in the CpsDataService - CpsAdminService uses CpsDataService to delete DataNodes Issue-ID: CPS-791 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I090500dbc4a2ccf061dc105f979472137d43b06d
2022-01-28Refactored Delete SchemaSet functionalityRenu Kumari3-19/+63
- Added get anchors by schemaset in cpsAdminService - Changed DeleteSchemaSet functionality - Use CPSAdminService to getAnchors associated with schemaset - Use CPSAdminService to delete Anchors - Moved Cascade allowed validation into Service from Persistence Issue-ID: CPS-791 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Ife7644551183cb8c3eb686a654b0a43a427ac1e5
2022-01-28Support 'public' Cm Handle PropertiesDylanB95EST2-50/+8
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-27Merge "Improve logging in NCMP"Toine Siebelink1-0/+61
2022-01-25Improve logging in NCMPsourabh_sourabh1-0/+61
Issue-ID: CPS-855 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I5d8a6a711d1c6b13d5d8eeba52a1dcd689dbdae2
2022-01-25Replace gson mapper with jackson mappersourabh_sourabh1-0/+87
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-11Send operation information in existing notification eventsRenu Kumari3-26/+68
Issue-ID: CPS-791 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Ic68dd476942291cf03afed99e95a245dafde5be9
2022-01-07CPS-Core: Unable to parse JSON input with space for POST endpointsourabh_sourabh1-0/+27
Issue-ID: CPS-831 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: If2f5f7034f05763990001c9dd8ccd9d8dc0099cf
2021-11-23CPS-314: Delete Dataspaceniamhcore2-0/+16
Issue-ID: CPS-314 Change-Id: I778e2b784c7b1ff3fecc1036425708dc4ec73227 Signed-off-by: niamhcore <niamh.core@est.tech>
2021-11-03Merge "Delete DataNode (xpath) for a given Anchor"Niamh Core1-0/+11
2021-11-02Delete DataNode (xpath) for a given AnchorDylanB95EST1-0/+11
Delete Datanode within CPS. Deprecates delete functionality of /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes. New api is backwards compatible with this API Issue-ID: CPS-313 Change-Id: I110c4ab1446e8a1399a0d9bf89c0be614a9104df Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-11-02Add get cm handles by modules names - service layerniamhcore1-0/+8
Issue-ID: CPS-644 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: Ic2a57df02d533a0066382c12c35be8d524b6cdad
2021-11-02Clean Up Code around List NodesDylanB95EST3-21/+29
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-09-07P2 - Get module names and revisions rest layerniamhcore1-2/+12
Issue-ID: CPS-485 Signed-off-by: niamhcore <niamh.core@est.tech> Change-Id: I1bcf45902207d0dba6b5dfe8277cb06571694db3
2021-09-06P1 - Get module name and revision persistence layerniamhcore1-6/+6
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-02Add property to enable Notification Sevice async processingRenu Kumari2-11/+6
- made notification service synchronous by default - added new property to enable async processing if required Issue-ID: CPS-630 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I28c2c98d7a79219a5932732d2940f5ac37bf1653
2021-08-25Add optional observed timestamp in the cps data apiaditya puthuparambil5-55/+120
- Added optional query parameter in cps data endpoints - Updated service layer and notification to use observedTimestamp Note: - NCMP REST endpoints are not updated as a part of this patch - NCMP does not sent observed timestamp when using cps data services Issue-ID: CPS-477 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I1f92da3da7b3a13c45405fdf44e5fef861991d9a Signed-off-by: Renu Kumari <renu.kumari@bell.ca>
2021-08-25Merge "Add timeout to async test-cases"Bruno Sakoto1-6/+12
2021-08-25Merge "Process data-updated event asynchronously"Toine Siebelink2-14/+29
2021-08-25Add timeout to async test-casesRenu Kumari1-6/+12
Issue-ID: CPS-526 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: Icf46f94090a615bf945eb70b58edf86c0c509155
2021-08-24Prepare for next event schema versionmr/584/123451/3Bruno Sakoto1-2/+1
Issue-ID: CPS-584, CPS-459 Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca> Change-Id: Iaf605492783f8c06f40522a427ce63bd2d1b34d0
2021-08-24Process data-updated event asynchronouslyRenu Kumari2-14/+29
- notification is processed asynchronously using defined threadpool - updated docker-compose and readme to add dataspace filtering variables Issue-ID: CPS-526 Signed-off-by: Renu Kumari <renu.kumari@bell.ca> Change-Id: I7f827250f45cb9e3db2f060e9b3a089a4eaee05c
2021-08-24Update CmHandle in DMI-Registry for a DMI-Plugin Instance in NCMP as part of ↵DylanB95EST2-2/+56
dmi registration. Updating existing CM-Handles created previously as part of CPS-442 Note - Can only update cm handles and properties which already exist. Issue-ID: CPS-443 Change-Id: Ib05a4e01336ca463578b45917dcdfe715b6bad07 Signed-off-by: DylanB95EST <dylan.byrne@est.tech>
2021-08-19Merge "Filter data updated events based on configured pattern"Niamh Core2-30/+49