diff options
Diffstat (limited to 'hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt')
-rw-r--r-- | hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt | 32 |
1 files changed, 7 insertions, 25 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 213f4544..443dfa2f 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 @@ -25,13 +25,14 @@ import org.jetbrains.spek.api.dsl.given 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.VesEventDomain import org.onap.dcae.collectors.veshv.model.VesMessage import org.onap.dcae.collectors.veshv.tests.utils.commonHeader import org.onap.dcae.collectors.veshv.tests.utils.vesEventBytes -import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.Domain -import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.Priority -import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.getDefaultInstance -import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.newBuilder + +import org.onap.ves.VesEventOuterClass.CommonEventHeader.Priority +import org.onap.ves.VesEventOuterClass.CommonEventHeader.getDefaultInstance +import org.onap.ves.VesEventOuterClass.CommonEventHeader.newBuilder internal object MessageValidatorTest : Spek({ @@ -46,8 +47,7 @@ internal object MessageValidatorTest : Spek({ assertThat(cut.isValid(vesMessage)).describedAs("message validation result").isTrue() } - Domain.values() - .filter { (it != Domain.UNRECOGNIZED && it != Domain.DOMAIN_UNDEFINED) } + VesEventDomain.values() .forEach { domain -> it("should accept message with $domain domain") { val header = commonHeader(domain) @@ -65,26 +65,8 @@ internal object MessageValidatorTest : Spek({ } } - - val domainTestCases = mapOf( - Domain.DOMAIN_UNDEFINED to false, - Domain.FAULT to true - ) - - domainTestCases.forEach { value, expectedResult -> - on("ves hv message including header with domain $value") { - val commonEventHeader = commonHeader(value) - val vesMessage = VesMessage(commonEventHeader, vesEventBytes(commonEventHeader)) - - it("should resolve validation result") { - assertThat(cut.isValid(vesMessage)).describedAs("message validation results") - .isEqualTo(expectedResult) - } - } - } - val priorityTestCases = mapOf( - Priority.PRIORITY_UNDEFINED to false, + Priority.PRIORITY_NOT_PROVIDED to false, Priority.HIGH to true ) |