aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
AgeCommit message (Collapse)AuthorFilesLines
5 daysMerge "Change order of CM Handle Reference lookup depending on special ↵Sourabh Sourabh1-0/+96
character"
6 daysChange order of CM Handle Reference lookup depending on special characterseanbeirne1-0/+96
- implemented new algorithm using validator to rule out standard id / prefer alternate id - moved validator imp to cps-service (not in RI) TBC!!! - changed order of characters tested in validator to fail fast (on '=') - added Boolean variation validator method to reduce overhead and prevent logic based on exceptions - improved integration test to cover all scenarios - add performance test for alternate id look up (report only) - ensured all performance test use alternate ids it '=' - added small groovy tests to restore cps-ri code coverage to 0.31 Issue-ID: CPS-2605 Change-Id: Id9c22bb69904b7f5d376b7f8319332428435333e Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Signed-off-by: seanbeirne <sean.beirne@est.tech>
13 daysHandle duplicated yang resource exception when creating schema sethalil.cakal1-1/+12
- catch and log duplicated yang resource during schema set creation - there may be other exception when the app started however there will be a tech. dept ticket for them thus please review this commit for only duplicated yang resource exception Issue-ID: CPS-2647 Change-Id: Idf6063cb8328efc667516f09d25ad6c4c6fd8186 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2025-02-11Merge "Query data nodes with limit"Toine Siebelink1-2/+17
2025-02-11Query data nodes with limitleventecsanyi1-2/+17
- added new methods to java interfaces - added integration test - removed unused methods Issue-ID: CPS-2394 Change-Id: Iac4094a5daedbf593d17f55928136a80391c6d23 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-02-06Merge "Fix duplicated yang resource references V2"Daniel Hanrahan5-43/+43
2025-02-06Fix duplicated yang resource references V2ToineSiebelink5-43/+43
- Store Yang module references using SchemaSetEntity instead of SQL - Added integration test to check number of references - Update dispatcher for integration test to only return yang resources requested modules - refactor schema set create & upgrade methods for better re-uses and readability - consistent naming in related methods like(new)yangResourceContentPerName (the name can be filename, module name or schema set name) depending on the context - replaced 'var' with actual class names in affected classes Issue-ID: CPS-2605 Change-Id: I8870c70832ac533bd17ce8af409a071f659e4acf Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-02-04Simple implementation of attribute-axisdanielhanrahan1-3/+2
This minimally implements attribute-axis using existing queryDataNodes API. Acceptance tests are un-ignored now. Issue-ID: CPS-2416 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ia06be3dd85dfce261d9d78529784d54d84b71bcd
2025-01-27Moved CpsValidator under the utils packageleventecsanyi7-7/+7
Issue-ID: CPS-2515 Change-Id: I57f6c10c8596281aed686552ad16e1dd6c15ff98 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-23Merge "Add DB Clean-up to CPS Rest Interface"Daniel Hanrahan1-4/+4
2025-01-23Add DB Clean-up to CPS Rest InterfaceToineSiebelink1-4/+4
- add dataspace filter to module cleanup impl - updated integration test to only delete orphaned modules in relevant dataspaces (this also fixes CPS-2571) - improved labels on admin controller test - add dataspaces/../clean rest endpoint for cps core - added 'Regular Maintenance' section to RTD Admin Guide - consistent spelling of 'CM Handle' in RTD Docs Issue-ID: CPS-2554 Change-Id: Ica70c3495758f073eaac9eeeadcc0e1be2c8cc1c Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2025-01-20Moved builders under impl in CPS Serviceleventecsanyi4-4/+4
- moved builders and fixed the Arch test Issue-ID: CPS-2542 Change-Id: Iac9d47f20fff2e6fa415ada8bc17880b0b032591 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-17Moved impl package out from api packageleventecsanyi10-185/+188
- refactored cps service packages and the architecture test Issue-ID: CPS-2543 Change-Id: I0fab54cebd157b19ff6105b7d4b6d8265a1af485 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2025-01-16One SchemaSet per moduleSetTagToineSiebelink4-98/+47
- Registration: create and upgrade cases. - Handle moduleSetTag deletion (all orphans) for testware - Unit tests updated - additional logging of details for upgrade scenarios - Integration Tests updated - Remove cache for module sets being processed - Removed DbCleaner (startup) - Removed redundant methods in NCMP Inventory for deleting schema set(s) - Removed validation check for all schema set interactions - Updated some schema set tests to use special characters previously not allowed - Checked integration test scenarios for upgrades with and without tags: all scenarios covered! TODO - REST endpoint to remove orphaned schema set data, separate story: CPS-2554 - Investigate exception handling regarding DuplicateYangResourceException: CPS-2555 Issue-ID: CPS-2540 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iaa59cbdb86b7a4a8044624829bc002506ff40cc7
2024-12-20Add schema to persist notification subscription informationrajesh.kumar2-0/+340
Add required schema to persist notification subscription information. It should contain - Schema yang file - New Dataspace, Anchors or any other database entity - Refactore duplicate code in NCMP Issue-ID:CPS-2427 Change-Id: I56c34400dc73c71b936a51260efd300924ababdc Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2024-12-05Moved common classes under the api package under apileventecsanyi22-44/+47
- moved common classes under the api package - moved Spec files Issue-ID: CPS-2512 Change-Id: I88046280ce359ce8cc488ad37d4e6f85406b0dbf Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2024-12-03Add tests of attribute-axis featuredanielhanrahan1-0/+8
Following TDD, functional acceptance tests are added for attribute-axis feature. This covers xpaths such as '//books/@title' - Add stub to CpsQueryService throwing UnsupportedOperationException - Add tests showing expected behaviour (tests currently ignored) - Implementation will be provided in following commmit for CPS-2416 Issue-ID: CPS-2416 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I71817e66b28dfc21e7b75243fd0135f3cceddb8e
2024-11-29Merge "XML content support on Replace list content"Priyank Maheshwari1-3/+33
2024-11-28De-Registration without Orphaned Module CheckToineSiebelink2-6/+45
- Testware updates to measure time spent for de-registration - Removed orphan check from module delete methods - Using @scheduled to run Db Cleaner method once (see https://lf-onap.atlassian.net/wiki/spaces/DW/pages/52494359/CPS-2478+Module+Sync+Inefficiencies#De-Registration:-Test-Measurements-With-and-Without-Orphanage-removal for reasoning) - Updated integration tests to call orphan check where need (after schema set deletion) Issue-ID: CPS-2478 Change-Id: I513af9d8bb88486a242284b58e0363a527346dd4 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2024-11-28XML content support on Replace list contentRudrangi Anupriya1-3/+33
Here to bring Support for XML Response Entity in Replace List content - Add ContentTypeInheadr in cpsData.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in DataRestController.java - Modify the code return xml Data - written testcase for above changes made Issue-ID: CPS-2411 Change-Id: Ibb7ffb66ccdd03703266123c6d5c2eade0e7cb4a Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-11-17XML content support for only cps Query v2Rudrangi Anupriya1-17/+17
Here to bring Support for XML Response Entity in query data nodes - Add ContentTypeInheadr in cpsQueryV2.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in QueryRestController.java - Implement logic to convert data to xml - written testcase for above changes made Issue-ID: CPS-2359 Change-Id: Ieb7eeb66ccbb03703626132c6d5c2eade0e7cb4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-11-05XML content support on get a nodeRudrangi Anupriya2-0/+94
Here to bring Support for XML Response Entity In GET A NODE - Made changes in components.yml to support contentType as application/xml - Add ContentTypeInheadr in cpsDataV2.yml to support application/xml - Add contentTypeInHeader parameter to accept xml in DataRestController.java - Implemented Logic to convert DataMaps To XML Data - written testcase for above changes made Issue-ID: CPS-2280 Change-Id: Ibe7ffb66ccbb03703626132c6d5c2eade0e7ab4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-10-09Implementation of Data validation feature in Create a Node APIArpit Singh7-19/+154
Added support to validate JSON/XML data without the need of persisting it in the databse. - added "dryRunInQuery" flag as a new query parameter - added new method as part of CpsDataService layer to perform data validation - added new method in yang parser "validateData" to validate data without persisting it Issue-ID: CPS-2361 Change-Id: I43dd33cc6120576d0fac606d5c4b0168d107311d Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-10-03Update JIRA and Wiki links host name from wiki.onap.org to lf-onap.atlassian.netsourabh_sourabh4-5/+5
Issue-ID: CPS-2432 Change-Id: I53f380a4fe0968d1ec9f1393651c7c43f03d0d95 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-09-24Remove Hazelcast cache for prefix resolver (CPS-2417 #2)danielhanrahan5-263/+6
This patch removes the AnchorDataCache from CPS, which is used for prefix resolution in get/query operations. As such, Hazelcast is no longer a dependency of CPS, only NCMP. - Changed PrefixResolver to be more efficient. - Removed AnchorDataCache and associated classes. - Moved HazelcastCacheConfig to NCMP. - Removed Hazelcast dependency from cps-service/pom.xml This shows good performance improvements in some APIs such as v2 GET which is nearly 2x faster (also 5x faster including base patch). Issue-ID: CPS-2417 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I24768469f24e90b70f7a6187faa4f5b3d75777d2
2024-09-24Reduce anchor lookups related to PrefixResolver (CPS-2417 #1)danielhanrahan1-6/+6
Instead of looking up same Anchor many times inside a for-loop, do it once outside the loop. This greatly improves performance in some cases, such as v2 GET API: - /cps/api/v2/dataspaces/{dataspace}/anchors/{anchor}/node Testing shows 3x faster response time. Issue-ID: CPS-2417 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I80d97d8cc24372eed70626ed840cad985cbe0a4b
2024-09-17Refactored cps-ri package structureleventecsanyi7-18/+17
- fixed import order and moved package structure Issue-ID: CPS-2293 Change-Id: Ie2f9f057f261577054530feee7480850ba4b41e1 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2024-09-10Renaming Delta Operations as per RFC 9144Arpit Singh2-12/+12
RFC 9144 recommends naming convention for operations that can be performed on any datastore. The recommended names are: - create - remove - replace Whereas in CPS Delta feature these operaitions were named: - add - remove - update So, "add" and "update" operations have been changed to "create" and "replace" respectively. Issue-ID: CPS-2393 Change-Id: Ie39f5f8ccc91e96cf484ca7fbc833a6be8758054 Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-08-13CPS-NCMP: Slow cmHandle registration when we use moduleSetTag, alternateId ↵sourabh_sourabh1-0/+17
and dataProducerIdentifier - Created a new repo. service for fragment table that executes a native sql query to find first ready cm handle id based on moduleset tag and then returns list of module references. - Exposed a new interface into module service that is used by module sync service to get list of midule refs by module set tag. Issue-ID: CPS-2353 Change-Id: I438dbd1ed37c1ff4e15f792e93a095aa604120bc Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-08-01XML content support on add list elementRudrangi Anupriya1-8/+14
Issue-ID: CPS-2287 Change-Id: Ibb7ffb66ccbb03703266132c6d5c2eade0e7cb4a Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-07-24Update response message for data validation failureArpit Singh1-2/+2
- Make the response message more informative and cleaner in case of data validation failure. - Updated message body will not contain the entire jsonData as part of response sent back to the user Issue-ID: CPS-2306 Change-Id: I28aab1450779af98ccdd11701e78bdfcdbc18cf0 Signed-off-by: Arpit Singh <as00745003@techmahindra.com>
2024-07-18Integration test to validate DMI service URLsourabh_sourabh1-1/+1
- New groovy test is written to validate if dmi service url is encoded correctly. Issue-ID: CPS-2317 Change-Id: I048bf37dd3ba4f37df7dace927f55bf8dd899922 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2024-07-16XML content support on replace a node with descendantsRudrangi Anupriya1-6/+39
Issue-ID: CPS-2282 Change-Id: Ibb7ffb65ccbb03703266712c6d5c2eade0e7ab4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-06-25Fix incorrect use of getAnchors(dataspace, schemasets)danielhanrahan3-17/+40
There is an issue in a method deleteDataNodes(dataspace, anchors) where it doesn't send data update events. This is because it fetches anchors using a method getAnchors(dataspace, schemaSetNames), when it needs to fetch anchors by name: getAnchors(dataspace, anchorNames) Changes: - Rename getAnchors method using schemasets to getAnchorsBySchemaSetNames - Add a method getAnchors(dataspace, anchorNames) - Update test of deleteDataNodes method using getAnchors so it checks that data update events are sent Issue-ID: CPS-2254 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I55fe853f0a9278a66a5724bf4cf2723b0e2fbc8b
2024-06-06CPS Delta API 2: Delta between anchor and payloadArpit Singh3-6/+98
- Second API to get Delta between an anchor and JSON payload - added new API getDeltaByDataspaceAnchorAndPayload - added controller and service layer methods getDeltaByDataspaceAnchorAndPayload - Core Delta algorithm remains same as the first API. getDeltaByDataspaceAnchorAndPayload will call getDeltaBetweenDataNodes Issue-ID: CPS-1836 Signed-off-by: Arpit Singh <as00745003@techmahindra.com> Change-Id: Id74cd930ce48e5cb414aa62c5381b79675788a37
2024-06-05XML content support on update node leavesRudrangi Anupriya1-12/+14
Issue-ID: CPS-2071 Change-Id: Ibe7f59fbfcbb03703626132c6d5c2afde0e7ab4b Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2024-05-08Conditional cps change eventsmpriyank1-6/+18
- introduced a parameter to control the cps core change event notifications. we should be able to disable these notifications without affecting other notification flows. - fixed the LayeredArchitectureTest as we are accessing the Anchor model in the events package now. Issue-ID: CPS-2213 Change-Id: Id875925bc14de1cc6e8fa3193c0df470e09fe43f Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-05-03[BUG] Correctly parse observedTimestampmpriyank2-41/+15
- Using the DateTimeUtility to parse the passed OffsetDateTime and using it for conversion to string - Moving to actual src/main/java from test side as it is to be used in the prod code as well and only keeping the methods in use. - Added test to fix the coverage issue Issue-ID: CPS-2211 Change-Id: I2b4325bb77a6da7fd470986b1da293f455650375 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-04-30Add Notification support in cps corerajesh.kumar3-4/+135
Add notification support using cloud events Issue-ID:CPS-2068 Change-Id: I56c34400dc73c71b936a51260efd240223babacd Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2024-04-26Faster module searches (CPS-2190 #3)danielhanrahan1-2/+2
This greatly improves performance of module searches by eliminating unneeded SQL queries via Hibernate lazy fetching. Issue-ID: CPS-2190 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ie9e65017d0027366456f1741cc37b10679317b25
2024-03-19Configure Hazelcast to have 1 backup to reduce memorydanielhanrahan1-2/+2
Currently Hazelcast is configured to have 3 synchronous backups and 3 asynchronous backups. These are separate, meaning there will be 7 copies in the cluster (1 original + 3 sync + 3 async backups). Even if only 1 instance of CPS/NCMP is running, it will have 7 copies in memory. Given that CPS/NCMP is typically only deployed using 1 or 2 instances, the settings are changed to 1 synchronous backup (same as Hazelcast's default configuration). This change has been tested and shown to reduce heap usage by around 100MB during 20K CM-handle registration. Issue-ID: CPS-2146 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I4a5f6d83bc35e2c13cfb32002e38dc365da34c8e
2024-02-01Extend API: Get Module Definitionshalil.cakal1-4/+14
- add query parameters: module-name and revision to OpenAPI - extend the controller method to hande the new parameters - add the new method stack to the service layer - extend the SQL query to support the new parameters - add unit and integration testwares Issue-ID: CPS-1135 Change-Id: I089ad2ad71effb58ac0ba809e9f441d6cdb59c4f Signed-off-by: halil.cakal <halil.cakal@est.tech>
2024-01-25CloudEvents support for cps-corempriyank1-0/+194
- Moving cloud events dependencies to the cps-service module instead of cps-ncmp-service - Testware has moved and new tests also introduced - EventsPublisher also moved Issue-ID: CPS-2040 Change-Id: Ibafb15e7e9efbdbe1e00e2b4f0da820bbcead004 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2024-01-19CPS 1824: Delta Between 2 Anchors release notesArpit Singh1-15/+13
Updated release notes for Delta Feature Issue-ID: CPS-1824 Signed-off-by: Arpit Singh <as00745003@techmahindra.com> Change-Id: I1c2403391e85aec6a9e34f0ff616c17b100bf6a9
2024-01-18Merge "CPS Delta API: Update action for delta service"Toine Siebelink1-29/+71
2024-01-17Clear instance based Schema Context Cache upon validation errorsToineSiebelink8-166/+298
- retry yang parser exceptions one time by clearing cache - split yangUtils into YangParserHelper (instance based) and YangUtils for non-parsering static methods - removed public methods only used from test. Refactored to use variation with (empty) parent path - removed use of optional for parentPath, easier to handle with just an empty string! - make methods no longer used in production code in YangUtils are private - udpate testware to use proper public methods instead of private methods of yang utils / parser (helper) Issue-ID:CPS-2000 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I0c7590a5e1495d047006e7136f1bd873be37f7b0
2024-01-16CPS Delta API: Update action for delta serviceArpit Singh1-29/+71
- Added code for Update action in Delta service - added method to get updated Leaf data: getUpdatedLeavesBetweenSourceAndTargetDataNode - added method to compare Leaf data common in source and target data node - added method to process leaves unique to target data node - added method to compare leaves: compareLeaves - added method to store updated data to a DeltaReport: addUpdatedLeavesToDeltaReport - Added corresponding testware Issue-ID: CPS-1824 Signed-off-by: Arpit Singh <as00745003@techmahindra.com> Change-Id: I3de07ea3227988784a0892f6a92c238ecf00a7fa
2024-01-09Remove inefficient saveListElementsBatch APIdanielhanrahan1-19/+1
CpsDataService::saveListElementsBatch method is not needed as saveListElements supports saving multiple list elements in a single operation. This both simplifies implementation and greatly improves performance when saving list elements, as the Yang parser need only run once for the whole batch. - Change InventoryPersistence to save CM-handles in batches of 100 using existing CpsDataService::saveListElements method. - Remove not needed CpsDataService::saveListElementBatch. Issue-ID: CPS-2019 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I8b74dda2917e094d064b42f2c0e4d57029b90395
2024-01-08Clean up cps temporal related notification codeJvD_Ericsson1-7/+0
- remove 'test' level folder - remove schemas but leave structure - remove 'data-updated' from test application.yaml - remove NOTIFICATION_DATASPACE_FILTER_PATTERNS from docker-compose Issue-ID: CPS-2005 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I3962d795c760de6ba5ff353e85894895437ad5e7
2023-12-18Remove the dependency-cycle between beansToineSiebelink6-77/+107
- Splitting admin service into AnchorService and DataspaceService (this resolves the cyclic dependency) - Improved Delete dataspace integration error tests (were depending on execution order, now independent) Issue-ID: CPS-871 Change-Id: I47efedb6eb4bd2900f72d689616b7b7b62df2938 Signed-off-by: halil.cakal <halil.cakal@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>