aboutsummaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service/src/test/groovy
AgeCommit message (Collapse)AuthorFilesLines
2023-11-02Handling Yang module upgrade error scenariossourabh_sourabh2-2/+36
- cm handle not ready, not found , invalid id Issue-ID: CPS-1802 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I2039faa44abbda17237e7c2dc085b4ac775c2039 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-11-02Initial Registration with trustLevel on NCMPseanbeirne1-8/+24
- Updated NcmpServiceCmHandle class to include registration trustLevel Issue-ID: CPS-1902 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I7c97928f5cdd82f3036a57ea5f0c149e2872f4f1
2023-10-23Introduce and use new Hazelcast map pt. 2sourabh_sourabh13-70/+150
- modified ModuleSyncService - created ModuleSetTagCacheConfig and tests - ensure both Create and Upgrade cm Handle use cases work - Moved inventory pkg to its right patha as production code. Issue-ID: CPS-1859 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I173dcd81fe2e74d86d85365b2ead461302cad974 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-19Code coverage: Update YANG schema set using moduleSetTagsourabh_sourabh4-13/+99
- Code coverage is increased to 98. - New groovy test is added to cover new code. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ia979be3f43ec8e4bbf6f8cb66a8a5e748118f19b Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-16Merge "Add withTrustLevel condition to CmHandle Query API"Toine Siebelink9-84/+168
2023-10-12Add withTrustLevel condition to CmHandle Query APIhalil.cakal9-84/+168
- Change untrustworthyCmHandleSet with trustLevelPerCmHandleMap - Change trust level cache config accordingly - Change device heartbet consumer accordingly - Add json schema for device trust level - Add with_trust_level enum into cm handle query conditions - Add query cm handle by trustlevel function to cm handle queries - Add query cm handle by trustlevel service to network cm proxy cm handle service - Add unit tests and fix code smells Issue-ID: CPS-1864 Change-Id: Ie214f0713cef779307d3379df81e2b95115b6d6d Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-10-11Expose REST endpoint to update YANG schema set using moduleSetTagsourabh_sourabh10-34/+53
- Added new schema to upgrade model into component. - Modified Ncmp rest input mapper to add upgradedCmHandles attributes. - Modified cm handle state mapper to add new lock reason. - Added new method to parse and upgrade Cm handles in DmiRegistration. - YANG data converter is modified to add "module-set-tag" atribute. - Cm handle new query method is added for cps path without appending ancestor. - Modified setCompositeStateForRetry to add lock reason. - New lock reason category is added. - Existing module sync service is modified to upgrade the model "syncAndCreateOrUpgradeSchemaSetAndAnchor". - Sync util method "getModuleSyncFailedCmHandles" to modified to add another lock reason "LOCKED_MISBEHAVING". - Added new attribute "UpgradedCmHandles" into DmiPluginRegistration and DmiPluginRegistrationResponse. - New attribute "moduleSetTag" is added into NcmpServiceCmHandle. - New model "UpgradedCmHandles" is added. - New method "updateSchemaSetWithExistingModules" is added into cps module service to update cm handle with exsting model. - Code coverage is reducced to 96 percentage that would be addressed and pushed into new patch. Issue-ID: CPS-1798 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I540acb404e38fc434de87a0d959bfde710a18b03 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-10-10Conflicting Error codesourabh_sourabh5-76/+76
-Used common error codes for NCMP responses Issue-ID: CPS-1904 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id2beaa9f3d49dffd0a193b05fbaa7a6dd801e34a Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-09-26Introduce and use new Hazelcast map for module set tagleventecsanyi2-5/+32
- added new IMap for moduleSetTags, updated SynchronizationCacheConfigSpec - updated deployment.rst Issue-ID: CPS-1859 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I5233c5150fd784974d7c1e5ba387119c1eaba194
2023-09-25Refactoring persistence classessourabh_sourabh29-170/+228
- Created a common ncmppersistence pkg inside ncmp service "api/impl" pkg". - Move "inventery" into "api/impl" pkg. - Created common class named as "NcmpPersistence" inside "ncmppersistence" pkg. - Move all the commin constants and methods into "NcmpPersistence". - SubscriptionPersistence and InventoryPersistence extends "NcmpPersistence". - Find and replace all the constants of NCMP. Issue-ID: CPS-1883 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Id3e678109766d680589fa7aab965ea251a55f075 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-09-25Merge "Reinstate Spring Boot 3.0 after revert"Toine Siebelink2-1/+4
2023-09-25Merge "Add DMI to TrustLevel Cache During Registration"Priyank Maheshwari2-6/+13
2023-09-22Reinstate Spring Boot 3.0 after revertegernug2-1/+4
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Iee5c514ccdba36a387f83948d8a3ba26e6b1de5b
2023-09-21Add DMI to TrustLevel Cache During Registrationseanbeirne2-6/+13
Issue-ID: CPS-1861 Signed-off-by: seanbeirne <sean.beirne@est.tech> Change-Id: I1e71b78eec9e2a9f536f82ef1ba5a9933ca2bf6b
2023-09-21Merge "Set lock state and reason upon request"Toine Siebelink7-35/+82
2023-09-20Revert "Migrate CPS to Spring-boot 3.0"Toine Siebelink2-4/+1
This reverts commit 9693ec51cf6526082f0ad0c3ad208d144cbbb163. Reason for revert: Bug fix delivery Change-Id: I73bdc1528192c662983b0bbef73b10b6d612a719 Signed-off-by: egernug <gerard.nugent@est.tech> Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
2023-09-18Set lock state and reason upon requestleventecsanyi7-35/+82
- added new LockReasonCategories and improved SyncUtils.isReadyForRetry - refactored logic aroudn retry times - refactored unit tests Issue-ID: CPS-1860 Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Change-Id: I4382d6ad1fa0a7d9dacb8c8281b0458a5afc0375
2023-09-18Merge "Migrate CPS to Spring-boot 3.0"Toine Siebelink2-1/+4
2023-09-14Migrate CPS to Spring-boot 3.0egernug2-1/+4
Issue-ID: CPS-1789 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: I932fca8a50cedf2ae0604401c5e2b27896e4d449
2023-09-04Dmi plugin watchdog cheking alivenesshalil.cakal2-2/+91
- Add capability of GET request into DmiRestClient - Add watchdog job to check aliveness of dmi plugins - DmiPluginStatus enum as UP or DOWN - Add unit tests for the new function in dmi rest client - Add unit tests for dmi watchdog Issue-ID: CPS-1856 Change-Id: Ic38a96f0485a0bfe1b6af5bb2f57f6119d8fa563 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-31Merge "Hazelcast cache config stroring trust level per dmi plugin"Priyank Maheshwari1-0/+87
2023-08-31Hazelcast cache config stroring trust level per dmi pluginhalil.cakal1-0/+87
- Add Hazelcast cache config to store trust level per dmi plugin Issue-ID: CPS-1855 Change-Id: Ibe7f8393008ca7352aacddba99ecd19d6e1eb326 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-29Extend model loader to support model-upgrade (part 2)ToineSiebelink3-4/+120
- add upgrade related methods to common abstract class - add new (agreed) inventory model - add InventoryModelLoader - add more logging for success cases - simplified constant names considering the context (class name) Issue-ID: CPS-1804 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I61a5c6d320d340a5c469ce20140f984439ba71a2
2023-08-24Extend model loader to support model-upgrade (part 1)ToineSiebelink2-157/+207
- refactor existign code for easier extension (no code changes yet, just want to review refactor in this first patch...) - changed log level of some (error) logging Issue-ID: CPS-1804 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I234ad6c4057e9447cd39a83b8f48799918ca6b7f
2023-08-21Replace event-id with correlation-id for data read operation cloud eventsourabh_sourabh1-1/+2
- Modified data operation event consumer to send correlation-id instead if event-id while publishing cloud event to client topic. Issue-ID: CPS-1842 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I30738b90d2ff0d14b5ee0bac680eff834aa968bf
2023-08-21Merge "Cm Subscription: PENDING logic handling in NCMP"Luke Gleeson5-106/+111
2023-08-18Merge "Device heartbeat listener"Luke Gleeson1-0/+102
2023-08-18Device heartbeat listenermpriyank1-0/+102
- Infrastructure code to have the kafka listener and distributed set in place - performance tested locally - testware added Issue-ID: CPS-1642 Change-Id: I775dbe6e6b520b8777faa08610db439877757572 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-18Modify data operation schema to accommodate additional informationsourabh_sourabh1-4/+4
- Code is modify to add resourceIdentifier and option to data operation kafka response for status code 100, 101, 102 and 103. Issue-ID: CPS-1837 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I1f7870d9d373f69de03240700b9d74be46fbfb6c Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-08-17Cm Subscription: PENDING logic handling in NCMPmpriyank5-106/+111
- Remove PENDING state from dmi schema - Modify ncmp out event mapper to categorize response per details - Rename class and method names as well as in unit tests - resolved the merge conflicts Issue-ID: CPS-1830 Change-Id: I5b7f523f546ec9940c246bd286586fdeba2f892e Signed-off-by: halil.cakal <halil.cakal@est.tech> Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-11Generic Cloud Event Mappermpriyank10-161/+88
- Introduced a generic event cloud mapper to be used all over the codebase - Added as a utility so we dont have to inject it as spring bean - Refactored code and added tests - Incorporated review comments Issue-ID: CPS-1827 Change-Id: I8dab914791e01bbf6492ce96e7ba6eaa8f75a6cb Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-09Refactoring Subscription Create LCM use casempriyank11-126/+127
- Client to NCMP: CmSubscriptionNcmpInEvent - NCMP to DMI: CmSubscriptionDmiInEvent - DMI to NCMP: CmSubscriptionDmiOutEvent - NCMP to Client: CmSubscriptionNcmpOutEvent - code package changed from avcsubscription to cmsubscription - Other classes name as per the events naming above - Test classes refactored - NO LOGIC changes incorporated in this patch Issue-ID: CPS-1831 Change-Id: Id5ad5f799007deaaf6d6fc0f402c130339263d09 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-08-09Modify DmiDataOperationRequest to make it identical as DataOperationRequestsourabh_sourabh1-1/+1
- Modified DmiDataOperationRequest attribute from operationType to operation. - Wrapped operation details to parent attribute operationd array. Issue-ID: CPS-1833 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I79aa943e10e1c32c3252a6eb4375c14496476f8b Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-08-04Subscription Creation: Fixes for code review after demohalil.cakal10-26/+201
- Change missleading subscription details in testware - Change datastore check to comply with CPS enum - Remove redundant CloudConstructionException - Change exception handling in cloud event mappers to avoid loss of information - Remove exception handling from scheduler service as discussed in the meeting Issue-ID: CPS-1732 Change-Id: I9fee2eafd4db97a0eed80e39219463c904f5a980 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-08-04Ability to disable sending auth headermpriyank1-0/+20
- introduced configurable parameter to disable sending auth header in the request to dmi-plugin - default is to include the auth header - DMI_AUTH_ENABLED flag can be set to true/false to control the behaviour - Also added the env variables to the CSITs - updated release-notes Issue-ID: CPS-1819 Change-Id: If97c06e33f06e391d2190b7300d73210ed2f4e27 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-07-31Add 'direct' keyword to descendants option to query direct children (ep1)Rudrangi Anupriya1-2/+1
-added 'direct' keyword also to Fetch Descendants Option along with 'all' and 'none' to Query direct child. -added unit tests to test direct keyword Issue-ID: CPS-1784 Change-Id: Icb7f59fbeebb03703626132d6d5d2cfde0e5ab4d Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-31Increase code coverage in cps-service moduleToineSiebelink3-8/+4
- After last rebase I had to remove 3 unused recent cloud eventd specific exceptions/constructors - Moved the only used new exception from SPI to the relevant util package (please NOTE not all exceptions belong in SPI and always question need for new exception when there is no specific handling, try to use standard or existign CPS exception instead!) - Increased cps-service module (line) coverage from 95 to 100% - Added tests for missing exceptions (handling i.e. thrown up) - Removed incorrect SPI defined OperationNotYetSupportedException (replaced with standard java exception instead) - Fixed some legacy issues with existign test classes I modified (unnecessary setup, conventions etc) - Increased coverage for DataNodeBuilder - Added or modified test to include more spi models - Added tests for Hazelcast Configs - Added more tests for json object mapper - Added test and fixed error handling in YangUtils/XmlFileUtils (it was incorrectly converting a config exception to a data validation exception) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I5852ba01bc5b33ae361b8f29daae9868f05baa35
2023-07-28Add 'direct' keyword to descendants option to query direct children (ep1)Rudrangi Anupriya1-1/+1
-added 'direct' keyword also to Fetch Descendants Option along with 'all' and 'none' to Query direct child. -added unit tests to test direct keyword Issue-ID:CPS-1784 Change-Id: Iab7f59fbeebb03703626132c6d5c2afde0e5ab4d Signed-off-by: Rudrangi Anupriya <ra00745022@techmahindra.com>
2023-07-26Subscription Creation: NCMP to Client CloudEvent transformationhalil.cakal10-192/+248
- Delete legacy avc subscription event and event outcome schemas - Change subscription response and outcome sample json file contents - Change ncmp event response code to support avc subscriptions - Add mapper that maps cloud event to subscription event response - Add mapper that maps subscription event outcome to cloud event - Change subscription event response consumer to consume CloudEvents - Change time out task to support response event instead client id and name - Change subscription event response mapper to support Cloud Event - Change subscription outcome mapper to group subscription responses as per details and status - Change subscription status to have fromString functionality - Change all unit tests to support new functionalities - Add cps exceptions for cloud event and outcome type - Add details field in yang model - Change data node helper to supoort details field - Consolidate final subscription response codes - Fix code smells reported by SonarLint Issue-ID: CPS-1739 Change-Id: I5eadeb8ef40d3d7befb762b5a8d2139fe3c85d7e Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-07-13Improved code coverage for NetworkCmProxyDataServiceImplToineSiebelink2-22/+27
- Production code had catch block that is no longer needed - Cleaned up some test somewhat (close to the new tests) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Iaa409e752a496bf088a58ccd422fe3d850442b59
2023-07-13Merge "Improved code coverage for record filter strategies"Sourabh Sourabh1-0/+41
2023-07-12Improved code coverage for record filter strategiesToineSiebelink1-0/+41
(the semi-integration test dont cover all scenarios) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I717946cddec315a1e69ca8d104b07f91691c1b63
2023-07-12Improved code coverage for Data Sync WatchdogToineSiebelink1-22/+32
- also cleaned up existing test (c&p errors in descriptions) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I20ed98faf0e05e2eb3b2aeaa92bed7dc73cbb358
2023-07-12Improved code coverage (branches) for sync watchdogToineSiebelink1-7/+43
- had to refactor prod. code slightly to make it testable - added a batch size check although the task is a simple iteration there is overhead in creating a paralel task Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I0db7ba3a15f4edc469a5af1ddc6fd76922b16809
2023-07-11Combine alreadyDefinedException classesdanielhanrahan2-7/+6
Issue-ID: CPS-1774 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10
2023-07-10NCMP fails to start if /subscription-registry already existsdanielhanrahan1-1/+2
cpsDataService only throws AlreadyDefinedException, not AlreadyDefinedExceptionBatch. This causes NcmpStartupException to be thrown during startup, if /subscription-registry exists. Issue-ID: CPS-1783 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I5667d891f855ef47ca2475891f9216be102932ed
2023-07-07Subscription Creation: NCMP to DMI CloudEvent transformationhalil.cakal6-75/+254
- Add mapper to convert client event into ncmp event - Add sample json object of ncmp version - Change subscription event consumer to consume CloudEvents - Change subscription event forwarder to publish CloudEvents - Change test producer config to support CloudEvents - Change sample subscription event json to comply with new schema - Add more test for missing branches - Change packages of the mappers into relevant directory Issue-ID: CPS-1737 Change-Id: I8c9e6e7bf713a8fb530a0586dfb2bce796a462f5 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-07-03Kafka (De)serializtion test case for legacy consumerraviteja.karumuri1-4/+23
# Added test case to verify the legacy consumer able to forward the event to client topic Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: I9c88023028eaa2453e5578b5afb4951a41bf4999
2023-06-29Kafka (De-)Serialization TestToineSiebelink3-17/+127
- added test that proof (de-)serialization of DataOperation CloudEvent - extracted new baseclass for kafka consumer tests Issue-ID: CPS-1746 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I3b04dc0ed8cd1f1f48206cbcf0fd739532ba423c
2023-06-29Merge "Updating the Kafka listener compliance to could events and legacy"Toine Siebelink5-29/+48