summaryrefslogtreecommitdiffstats
path: root/cps-ncmp-service
AgeCommit message (Collapse)AuthorFilesLines
2023-07-19Prepare for next CPS-NCMP releaseegernug1-1/+1
Issue-ID: CPS-1791 Signed-off-by: egernug <gerard.nugent@est.tech> Change-Id: Ide0fcdfa41656e25395ac8478da1bb489fd8663e
2023-07-13Improved code coverage for NetworkCmProxyDataServiceImplToineSiebelink3-41/+37
- 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-13Introduced a dmi rest demo csit stubsourabh_sourabh1-0/+1
- Introduced a new response code 0 for data operational success response. - Created a new dmi plugin rest stub for demo and performance testing. - Removed dmi plugin stub of wiremocked. - Updated parent pom to add newely created demo stub. - updated docker compose to add neww demo stub with profile for CSIT, demo and performance testing. - Removed target id list from unsupported operation/datastore from REST response. Issue-ID: CPS-1560 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ie8198366df820e7d4b8b6e8a85ff9cdb0fce7435 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
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 watchdogToineSiebelink2-13/+50
- 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 classesdanielhanrahan4-12/+10
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 existsdanielhanrahan2-2/+4
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.cakal14-144/+473
- 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-30Merge "Kafka (De-)Serialization Test"Sourabh Sourabh3-17/+127
2023-06-30Prepare for next CPS-NCMP releasempriyank1-1/+1
- updated the docs. - Bumped the version to 3.3.4-SNAPSHOT for the next release. Issue-ID: CPS-1773 Change-Id: Ibe9a694baadb33d284913868452b143c14d105cc Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
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 "Clearing code smells"Toine Siebelink1-3/+6
2023-06-29Clearing code smellsToineSiebelink1-3/+6
- added/updated @deprecated javadoc in EventPublisher Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ic0fa3efbc7dc580368bed6782db683b3c7a4d918
2023-06-29Merge "Updating the Kafka listener compliance to could events and legacy"Toine Siebelink10-92/+136
2023-06-29Updating the Kafka listener compliance to could events and legacyraviteja.karumuri10-92/+136
# Added filter property to the legay(DMIAsync) Consumer # Added containerFactory property to the CloudEvent(DataOperation) consumer to use 'cloudEventDeserializtion' Issue-ID: CPS-1746 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: I73315b816eb6446b7e163fd8779bc35fd6cbef63
2023-06-29NCMP : NCMP : Handle non responding DMI-Pluginsourabh_sourabh4-21/+90
- Added new response code for non-responding dmi and non-success. - Captured any exception after sending request to dmi service and then create a cloud event with error code and publish it to client topic. - Minor modificarion into resource data operation util class. Issue-ID: CPS-1558 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I39d409fb42856b816bf9833c2a23f7fa250a1e62 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-28Improved code covage (branches) around cm handle state changesToineSiebelink2-10/+40
- added test - removed redundant (unreachable) check in production code Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ia39ac7a1473a248710c2a52f65715fb6b6a85fca
2023-06-28Merge "Streamline outcome response for subscription creation"Priyank Maheshwari11-53/+182
2023-06-27NCMP : Handle non-existing and non-ready cm handlessourabh_sourabh18-181/+637
- Modified data operation schema to contains cm handle as steing and response content field name as result. - Added a new common cloud event builder for NCMP to create an event. - Added data operation event creater that uses cloud event builder to create a cloud event. - Introduced a new method onto json object mapper to convert json object to bytes. - Modified EventDateTimeFormatter and added a new method to convert date timestamp into offsetdateTime. - Added a new code into ResourceRequestUtil to identify non-ready cm handle and non-existing cm handle and later publish it as cloud event to tha client given topic. - Introduced CpsApplicationContext to get spring mannaged bean into non spring managed java object. Issue-ID: CPS-1583, CPS-1614 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I24a39d2cb2c54dea25cd2f17e7748e21cd83a088 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-26Streamline outcome response for subscription creationhalil.cakal11-53/+182
- Pivot to outcome response generated from db for the corresponding subscription - Fine tuning to wait till the cutoff time for all cm handles that subject to subscription - Update cm handles as rejected if dmi plugin or cm handles does not exist in db - Add more test for missed branches in mappers and response outcome Issue-ID: CPS-1741 Change-Id: I82ab6958e673059977abc7708974d5a2cb13e339 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-26KafkaListener config for CloudEventsmpriyank4-18/+48
- Introduced kafkalistener factory configs to correctly use the configs and convert the incoming events to CloudEvents - Also legacy events to use a separate listener factory - Increased the wait time from 100ms to 300ms to listen to the message in the test Issue-ID: CPS-1764 Change-Id: I8b9fe0ba82ef87d52b7731941ccd3af8ae980109 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-06-23#2 NCMP : Replacing the word 'Batch' as 'DataOperation'.raviteja.karumuri8-74/+76
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ib04e9d8a909e8868bf094e2625412996409b3a67
2023-06-23Merge "Improve code coverage"Luke Gleeson1-12/+25
2023-06-22Improve code coverageToineSiebelink1-12/+25
cleaned up the modified test a bit as well Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I0a6ac50bb5720935c5c1c7036ada8423b3174fda
2023-06-22NCMP : Replacing the word 'Batch' as 'DataOperation'.raviteja.karumuri11-92/+93
Issue-ID: CPS-1754 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ie9f56effb160582ba7177331fb6260b2bde2342b
2023-06-21Merge "Remove irrelevant groovy class that tests nothing"Toine Siebelink1-57/+0
2023-06-21Improve handling of legacy eventsToineSiebelink2-19/+62
Legacy (non-cloud) events would cause a NPE in the event filter Although the event woudl still be ignored it would lead to uncessary error logging This fix addressed this issue using a trace level message instead (also some improvements in the associated test) Issue-ID: CPS-1724 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ibf71b13e4a47aaf705e32df5fe50cf41de5f558f
2023-06-21Remove irrelevant groovy class that tests nothinghalil.cakal1-57/+0
Issue-ID: CPS-1741 Change-Id: If27a74e2496b952eb4803bbabb8363400c57915a Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-21Merge "Patch # 3: Data operation response event (NCMP → Client App) to ↵Toine Siebelink10-74/+151
comply with CloudEvents"
2023-06-21Patch # 3: Data operation response event (NCMP → Client App) to comply ↵sourabh_sourabh10-74/+151
with CloudEvents - Modified data operation record strategy to consume cloud event. - Modified NCMP data operation event consumer to read cloud event header. (prefixed with ce_) - Modified event publisher to support legacy and cloud event based on event type (if legacy event use legacy kafka template else cloud kafka template). - Introduced a new method onto json object mapper to convert json object to bytes. - Modified data operation consumer spec to produce a cloud event and validate it. - Added Kafka Integration Test (for filtering) Issue-ID: CPS-1724 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ide701b1ff952f57413cb4e4aa0d55c08753f0298 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-21publishLcmEventBatchAsynchronously is not asyncdanielhanrahan4-48/+85
Spring @Async has a limitation where calling the async method from within the same class won't work, as the method needs to be proxied, and calling from the same class bypasses the proxy and calls the underlying method directly, thus running synchronously. Issue-ID: CPS-1749 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I7f198487dc18b359654dc38b5cf8fd600d33e189
2023-06-20Merge "DMI Data AVC to cloud events"Luke Gleeson5-91/+51
2023-06-20Merge "Patch # 1: Data operation response event (NCMP → Client App) to ↵Toine Siebelink4-59/+44
comply with CloudEvents"
2023-06-19Patch # 1: Data operation response event (NCMP → Client App) to comply ↵sourabh_sourabh4-59/+44
with CloudEvents - Removed header definitions (since we now use CloudEvents) - Used 'dataOperation' instead of batch where appropriate. - Modified test json Issue-ID: CPS-1724 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: Ic0f65297b944adf9cf5f3c2cbec679a031a675ec Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-19Merge "Code to persist or update the yang model subscription into db"Priyank Maheshwari7-54/+220
2023-06-19Code to persist or update the yang model subscription into dbhalil.cakal7-54/+220
- Change subscription persistence for subscription registry to handle adding or updating cm handles into db Issue-ID: CPS-1735 Change-Id: Icae609e810b2a097a4a174de1691892526f6b5c0 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-19DMI Data AVC to cloud eventsmpriyank5-91/+51
- DMI Data AVC to be consumed as CloudEvents now - Removed the schema header as it is taken care by cloudevent headers - Implemented naming and packaging comments on the schema - Test cases refactoring Issue-ID: CPS-1719 Change-Id: I9864f90446720fe903fb3c1502d86035d886751d Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-06-15Merge "Patch #2 : Introduce kafka template for cloud events"Toine Siebelink10-36/+260
2023-06-15Patch #2 : Introduce kafka template for cloud eventssourabh_sourabh10-36/+260
- Introduced a new cloud kafka template for cloud events that reads it's configuration from application.yml - Kept legacy kafka template for backward compatibility utill all cps events moved to cloud event comply. - Modified application.yml producer and consumer value deserializer properties to support cloud events. - Added new cloudevents-bom used into cps-ncmp-service pom. - For the time being we will have 2 kafkatemplates (legacyEventKafkaTemplate, cloudEventKafkaTemplate) into EventsPublisher until we fully move to cloudevents for all events. Once all cps events will be cloud event compy, we have TODO task where Deprecated: legacyKafkaEventTemplate will be removed with its java configuration file KafkaTemplateConfig. Issue-ID: CPS-1724 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I78c15bd480db063b89c6630c46c2d3a328b4fae4 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-06-15Bump CPS version to 3.3.3-SNAPSHOTdanielhanrahan1-1/+1
- Update version properties as well as we prepare for the next release. Issue-ID: CPS-1750 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I0626eee7834499d2fa96812fb416ce7daebf0529
2023-06-07Agreed outstanding comments including package refactoringhalil.cakal11-33/+55
- Change package of AVC Subscription relevent codes into their place - Change package of Subscription Event Cache config inot its place - Add more branches for subscription outcome mapper - Add more branches for subscription event response consumer - Change unit test method params in order not to use deprecated methods Issue-ID: CPS-1730 Change-Id: Ieda587d5be318db8360d52d49dc38d7ce3dd85cd Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-07Fix some code smellshalil.cakal2-7/+7
Issue-ID: CPS-1507 Change-Id: Ic11ccbb37538242cb65ab1dbdde4fc77d9f94bdf Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-07Merge "NCMP : forward bulk response messages to client topic"Sourabh Sourabh2-8/+8
2023-06-06NCMP : forward bulk response messages to client topicraviteja.karumuri2-8/+8
# Fixing the avc subscription event is not consuming even there is a record published on to the topic. Issue-ID: CPS-1557 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: If09fd1849f467785141cc56639839ddda9f2c0de
2023-06-01Subscription Create Event Outcome Kafka Parthalil.cakal24-123/+748
- Add subscription event outcome schema with java type for pojos - Add subscription event outcome json for testing - Add mapper to convert subscription response to event outcome - Add a bean to handle subscription response outcome tasks - Change response consumer to publish outcome for client app - Change response timeout task to publish outcome for client app - Change subscription persistance to read datanodes - Add helper to extract cm handle to status mapping from data nodes event - Fix code smells Issue-ID: CPS-1507 Change-Id: I70195073490f456f014e53c1f59d1b6761d18cd4 Signed-off-by: halil.cakal <halil.cakal@est.tech>
2023-06-01NCMP : forward bulk response messages to client topicraviteja.karumuri1-4/+9
# Fixing the NullPointer Exception if the 'eventType' header not availabe. # eventType header is a mandatory header but still we are doing null check for supporting old events (AsyncResponseEvent is not moved to separate kafka headers) Issue-ID: CPS-1557 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: Ie7923d0e2674402fa36cb28cde966575b899cedb
2023-05-30Merge "Improve error scenarios SubscriptionEventForwarder"Priyank Maheshwari3-6/+50