diff options
author | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-11-20 11:43:23 +0100 |
---|---|---|
committer | Jakub Dudycz <jakub.dudycz@nokia.com> | 2018-11-20 12:15:11 +0100 |
commit | 7d802e8716b08f84839307bf6a184d4c145800ca (patch) | |
tree | 1e6c4fb2bff8436618e9a0344d0bf850b26a57ec /hv-collector-core | |
parent | e3e2a55c10f00c26a565cdf30a5ae2b49604344d (diff) |
Update proto file to v14
- update proto file
- update vesEventListenerVersion validation regex
to match new requirements
Change-Id: Ic0bd855fd03caa3ca3120b2c49d5fa4f53de2540
Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Issue-ID: DCAEGEN2-984
Diffstat (limited to 'hv-collector-core')
-rw-r--r-- | hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt index 25bd4f67..3090042d 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt @@ -94,19 +94,34 @@ internal object MessageValidatorTest : Spek({ } } - on("ves hv message including header with vesEventListenerVersion field not matching required pattern") { - val commonHeader = commonHeader(vesEventListenerVersion = "1.2.3") - val commonHeader2 = commonHeader(vesEventListenerVersion = "sample-version") + on("ves hv message including header.vesEventListenerVersion with non-string major part") { + val commonHeader = commonHeader(vesEventListenerVersion = "sample-version") + val rawMessageBytes = vesEventBytes(commonHeader) + + + it("should not accept message header") { + val vesMessage = VesMessage(commonHeader, rawMessageBytes) + assertThat(cut.isValid(vesMessage)).describedAs("message validation result").isFalse() + } + } + on("ves hv message including header.vesEventListenerVersion with major part != 7") { + val commonHeader = commonHeader(vesEventListenerVersion = "1.2.3") val rawMessageBytes = vesEventBytes(commonHeader) - val rawMessageBytes2 = vesEventBytes(commonHeader2) it("should not accept message header") { val vesMessage = VesMessage(commonHeader, rawMessageBytes) assertThat(cut.isValid(vesMessage)).describedAs("message validation result").isFalse() + } + } + + on("ves hv message including header.vesEventListenerVersion with minor part not starting with a digit") { + val commonHeader = commonHeader(vesEventListenerVersion = "7.test") + val rawMessageBytes = vesEventBytes(commonHeader) - val vesMessage2 = VesMessage(commonHeader2, rawMessageBytes2) - assertThat(cut.isValid(vesMessage2)).describedAs("second message validation result").isFalse() + it("should not accept message header") { + val vesMessage = VesMessage(commonHeader, rawMessageBytes) + assertThat(cut.isValid(vesMessage)).describedAs("message validation result").isFalse() } } } |