diff options
author | 2021-03-31 13:43:34 +0200 | |
---|---|---|
committer | 2021-04-01 10:51:50 +0200 | |
commit | 516014379cdc27d163be223bb8ce9f87d72dea1f (patch) | |
tree | 680fa171ca6b9fa2b439f0ea727b96618c8ca158 /sources/hv-collector-test-utils | |
parent | c398d5afd86d1aedab9cbd7b8f8c3d7b48eb2e2b (diff) |
Add stndDefined domain to HV-VES1.8.0
- Updated SDK dependency to 1.8.2 so HV-VES recognizes
stndDefinedNamespace field during events deserialization
- Added new domain stndDefined
- Added routings specific for stndDefined events which is controled
by stndDefinedNamespace field, not domain
- Bumped HV-VES to 1.8.0
Signed-off-by: Michal Banka <michal.banka@nokia.com>
Change-Id: Ia27f2de7a4b64df5e8a182888006f7e8a941ca63
Issue-ID: DCAEGEN2-2702
Diffstat (limited to 'sources/hv-collector-test-utils')
-rw-r--r-- | sources/hv-collector-test-utils/pom.xml | 2 | ||||
-rw-r--r-- | sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt | 57 |
2 files changed, 32 insertions, 27 deletions
diff --git a/sources/hv-collector-test-utils/pom.xml b/sources/hv-collector-test-utils/pom.xml index d1e75660..67eee86a 100644 --- a/sources/hv-collector-test-utils/pom.xml +++ b/sources/hv-collector-test-utils/pom.xml @@ -14,7 +14,7 @@ <parent> <groupId>org.onap.dcaegen2.collectors.hv-ves</groupId> <artifactId>hv-collector-sources</artifactId> - <version>1.7.0-SNAPSHOT</version> + <version>1.8.0-SNAPSHOT</version> <relativePath>..</relativePath> </parent> diff --git a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt index 3013e904..2583d219 100644 --- a/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt +++ b/sources/hv-collector-test-utils/src/main/kotlin/org/onap/dcae/collectors/veshv/tests/utils/vesEvents.kt @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * dcaegen2-collectors-veshv * ================================================================================ - * Copyright (C) 2018 NOKIA + * Copyright (C) 2018-2021 NOKIA * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ import com.google.protobuf.MessageLite import org.onap.dcae.collectors.veshv.domain.ByteData import org.onap.dcae.collectors.veshv.domain.PayloadContentType import org.onap.dcae.collectors.veshv.domain.VesEventDomain -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP +import org.onap.dcae.collectors.veshv.domain.VesEventStndDefinedNamespace import org.onap.dcae.collectors.veshv.domain.WireFrameMessage import org.onap.ves.VesEventOuterClass import org.onap.ves.VesEventOuterClass.CommonEventHeader @@ -34,7 +34,7 @@ import java.time.Instant import java.time.temporal.Temporal import java.util.UUID.randomUUID -fun vesEvent(domain: VesEventDomain = PERF3GPP, +fun vesEvent(domain: VesEventDomain = VesEventDomain.PERF3GPP, id: String = randomUUID().toString(), eventFields: ByteString = ByteString.EMPTY, vesEventListenerVersion: String = "7.0.2" @@ -50,32 +50,37 @@ fun vesEvent(commonEventHeader: CommonEventHeader, .setEventFields(eventFields) .build() -fun commonHeader(domain: VesEventDomain = PERF3GPP, +fun commonHeader(domain: VesEventDomain = VesEventDomain.PERF3GPP, id: String = randomUUID().toString(), vesEventListenerVersion: String = "7.0.2", priority: Priority = Priority.NORMAL, - lastEpochMicrosec: Long = 100000005 -): CommonEventHeader = - CommonEventHeader.newBuilder() - .setVersion("sample-version") - .setDomain(domain.domainName) - .setSequence(1) - .setPriority(priority) - .setEventId(id) - .setEventName("sample-event-name") - .setEventType("sample-event-type") - .setStartEpochMicrosec(100000000) - .setLastEpochMicrosec(lastEpochMicrosec) - .setNfNamingCode("sample-nf-naming-code") - .setNfcNamingCode("sample-nfc-naming-code") - .setNfVendorName("vendor-name") - .setReportingEntityId(ByteString.copyFromUtf8("sample-reporting-entity-id")) - .setReportingEntityName("sample-reporting-entity-name") - .setSourceId(ByteString.copyFromUtf8("sample-source-id")) - .setSourceName("sample-source-name") - .setTimeZoneOffset("+1") - .setVesEventListenerVersion(vesEventListenerVersion) - .build() + lastEpochMicrosec: Long = 100000005, + stndDefinedNamespace: VesEventStndDefinedNamespace? = null): CommonEventHeader { + val builder = CommonEventHeader.newBuilder().setVersion("sample-version") + .setDomain(domain.domainName) + .setSequence(1) + .setPriority(priority) + .setEventId(id) + .setEventName("sample-event-name") + .setEventType("sample-event-type") + .setStartEpochMicrosec(100000000) + .setLastEpochMicrosec(lastEpochMicrosec) + .setNfNamingCode("sample-nf-naming-code") + .setNfcNamingCode("sample-nfc-naming-code") + .setNfVendorName("vendor-name") + .setReportingEntityId(ByteString.copyFromUtf8("sample-reporting-entity-id")) + .setReportingEntityName("sample-reporting-entity-name") + .setSourceId(ByteString.copyFromUtf8("sample-source-id")) + .setSourceName("sample-source-name") + .setTimeZoneOffset("+1") + .setVesEventListenerVersion(vesEventListenerVersion) + + stndDefinedNamespace?.let { + builder.setStndDefinedNamespace(stndDefinedNamespace.stndDefinedNamespace) + } + return builder.build() +} + fun emptyWireProtocolFrame(): WireFrameMessage = wireProtocolFrameWithPayloadSize(0) |