diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2024-11-07 09:59:25 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-11-07 09:59:25 +0000 |
commit | 76b4ff600dfefd2bea79a43431e36698e86c4a5a (patch) | |
tree | 02908e8dd5986b47902b3ce4daf69db5e0065402 /k6-tests/once-off-test/kafka/produce-avc-event.js | |
parent | b718a200ee1da4b65ce87ea2a004317a363fdcb3 (diff) | |
parent | 2dd658268202f92e0b5621093747f13670e5d042 (diff) |
Merge "Cm Avc Event to have same key"
Diffstat (limited to 'k6-tests/once-off-test/kafka/produce-avc-event.js')
-rw-r--r-- | k6-tests/once-off-test/kafka/produce-avc-event.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/k6-tests/once-off-test/kafka/produce-avc-event.js b/k6-tests/once-off-test/kafka/produce-avc-event.js index 981a21af65..db222f6a4a 100644 --- a/k6-tests/once-off-test/kafka/produce-avc-event.js +++ b/k6-tests/once-off-test/kafka/produce-avc-event.js @@ -50,6 +50,11 @@ export const options = { } }; +const getRandomNetworkElement = () => { + const networkElementIds = Array.from({ length: 10 }, (_, i) => `neType-${i + 1}`); + return networkElementIds[Math.floor(Math.random() * networkElementIds.length)]; +}; + function getCloudEventHeaders() { return { ce_type: 'org.onap.cps.ncmp.events.avc1_0_0.AvcEvent', @@ -65,10 +70,11 @@ function getCloudEventHeaders() { export function sendKafkaMessages() { const cloudEventHeaders = getCloudEventHeaders(); + const networkElementId = getRandomNetworkElement(); const avcCloudEvent = { key: schemaRegistry.serialize({ - data: cloudEventHeaders.ce_correlationid, + data: networkElementId, schemaType: SCHEMA_TYPE_STRING, }), value: schemaRegistry.serialize({ |