diff options
author | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2018-10-01 07:54:26 +0200 |
---|---|---|
committer | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2018-10-01 08:16:05 +0200 |
commit | fd44b433ac9825be6cc654e8a566f9d0bfc70166 (patch) | |
tree | f720c9d891bc43ee1abbb4662a72d1b942f31d47 /hv-collector-ves-message-generator/src/test/kotlin | |
parent | 069dcc194fd049e1c52e60d03ce2a9c0553289a7 (diff) |
HV-VES Domain update
Change domain name. In this project this yields following changes:
* Comment change in VesEvent proto
* Updated measurements proto (kept as documentation only, ie. not used
in the collector)
* Update name in test scenarios for unit and component scope
Change-Id: I719077b5fcb642c067d25b7aa174a2e629404689
Issue-ID: DCAEGEN2-847
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'hv-collector-ves-message-generator/src/test/kotlin')
2 files changed, 15 insertions, 15 deletions
diff --git a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt index e380f931..dedf5ccf 100644 --- a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt +++ b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/MessageGeneratorImplTest.kt @@ -30,7 +30,7 @@ import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on import org.onap.dcae.collectors.veshv.domain.ByteData import org.onap.dcae.collectors.veshv.domain.WireFrameMessage -import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HVMEAS +import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP import org.onap.dcae.collectors.veshv.domain.VesEventDomain.FAULT import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HEARTBEAT import org.onap.dcae.collectors.veshv.tests.utils.commonHeader @@ -54,7 +54,7 @@ object MessageGeneratorImplTest : Spek({ val limit = 1000L generator .createMessageFlux(listOf(MessageParameters( - commonHeader(HVMEAS), + commonHeader(PERF3GPP), MessageType.VALID ))) .take(limit) @@ -67,7 +67,7 @@ object MessageGeneratorImplTest : Spek({ it("should create message flux of specified size") { generator .createMessageFlux(listOf(MessageParameters( - commonHeader(HVMEAS), + commonHeader(PERF3GPP), MessageType.VALID, 5 ))) @@ -98,7 +98,7 @@ object MessageGeneratorImplTest : Spek({ generator .createMessageFlux(listOf(MessageParameters( - commonHeader(HVMEAS), + commonHeader(PERF3GPP), MessageType.TOO_BIG_PAYLOAD, 1 ))) @@ -106,7 +106,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isTrue() assertThat(it.payloadSize).isGreaterThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(HVMEAS.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) } .verifyComplete() } @@ -115,7 +115,7 @@ object MessageGeneratorImplTest : Spek({ it("should create flux of messages with invalid payload") { generator .createMessageFlux(listOf(MessageParameters( - commonHeader(HVMEAS), + commonHeader(PERF3GPP), MessageType.INVALID_GPB_DATA, 1 ))) @@ -133,7 +133,7 @@ object MessageGeneratorImplTest : Spek({ it("should create flux of messages with invalid version") { generator .createMessageFlux(listOf(MessageParameters( - commonHeader(HVMEAS), + commonHeader(PERF3GPP), MessageType.INVALID_WIRE_FRAME, 1 ))) @@ -141,7 +141,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isFalse() assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(HVMEAS.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) assertThat(it.versionMajor).isNotEqualTo(WireFrameMessage.SUPPORTED_VERSION_MINOR) } .verifyComplete() @@ -159,7 +159,7 @@ object MessageGeneratorImplTest : Spek({ .assertNext { assertThat(it.isValid()).isTrue() assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractHvRanMeasFields(it.payload).size()).isEqualTo(MessageGenerator.FIXED_PAYLOAD_SIZE) + assertThat(extractEventFields(it.payload).size()).isEqualTo(MessageGenerator.FIXED_PAYLOAD_SIZE) assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(FAULT.name) } .verifyComplete() @@ -170,7 +170,7 @@ object MessageGeneratorImplTest : Spek({ it("should create concatenated flux of messages") { val singleFluxSize = 5L val messageParameters = listOf( - MessageParameters(commonHeader(HVMEAS), MessageType.VALID, singleFluxSize), + MessageParameters(commonHeader(PERF3GPP), MessageType.VALID, singleFluxSize), MessageParameters(commonHeader(FAULT), MessageType.TOO_BIG_PAYLOAD, singleFluxSize), MessageParameters(commonHeader(HEARTBEAT), MessageType.VALID, singleFluxSize) ) @@ -178,7 +178,7 @@ object MessageGeneratorImplTest : Spek({ .test() .assertNext { assertThat(it.payloadSize).isLessThan(WireFrameMessage.MAX_PAYLOAD_SIZE) - assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(HVMEAS.name) + assertThat(extractCommonEventHeader(it.payload).domain).isEqualTo(PERF3GPP.name) } .expectNextCount(singleFluxSize - 1) .assertNext { @@ -201,6 +201,6 @@ fun extractCommonEventHeader(bytes: ByteData): CommonEventHeader = VesEvent.parseFrom(bytes.unsafeAsArray()).commonEventHeader -fun extractHvRanMeasFields(bytes: ByteData): ByteString = +fun extractEventFields(bytes: ByteData): ByteString = VesEvent.parseFrom(bytes.unsafeAsArray()).eventFields diff --git a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt index 45e936a6..00c08aa7 100644 --- a/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt +++ b/hv-collector-ves-message-generator/src/test/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/impl/impl/parameters.kt @@ -26,7 +26,7 @@ private const val validMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "HVMEAS", + "domain": "PERF3GPP", "sequence": 1, "priority": 1, "eventId": "sample-event-id", @@ -48,7 +48,7 @@ private const val validMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "HVMEAS", + "domain": "PERF3GPP", "sequence": 1, "priority": 1, "eventId": "sample-event-id", @@ -76,7 +76,7 @@ private const val invalidMessageParameters = { "commonEventHeader": { "version": "sample-version", - "domain": "HVMEAS", + "domain": "PERF3GPP", "sequence": 1, "priority": 1, "eventId": "sample-event-id", |