aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt')
-rw-r--r--hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt17
1 files changed, 10 insertions, 7 deletions
diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt
index c852f5f4..599a9d40 100644
--- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt
+++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt
@@ -19,12 +19,15 @@
*/
package org.onap.dcae.collectors.veshv.impl
+import arrow.core.None
+import arrow.core.Some
import org.assertj.core.api.Assertions.assertThat
import org.jetbrains.spek.api.Spek
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.model.RoutedMessage
import org.onap.dcae.collectors.veshv.model.VesMessage
import org.onap.dcae.collectors.veshv.model.routing
import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader
@@ -61,15 +64,15 @@ object RouterTest : Spek({
}
it("should be routed to proper partition") {
- assertThat(result?.partition).isEqualTo(2)
+ assertThat(result.map(RoutedMessage::partition)).isEqualTo(Some(2))
}
it("should be routed to proper topic") {
- assertThat(result?.topic).isEqualTo("ves_rtpm")
+ assertThat(result.map(RoutedMessage::topic)).isEqualTo(Some("ves_rtpm"))
}
it("should be routed with a given message") {
- assertThat(result?.message).isSameAs(message)
+ assertThat(result.map(RoutedMessage::message)).isEqualTo(Some(message))
}
}
@@ -82,15 +85,15 @@ object RouterTest : Spek({
}
it("should be routed to proper partition") {
- assertThat(result?.partition).isEqualTo(0)
+ assertThat(result.map(RoutedMessage::partition)).isEqualTo(Some(0))
}
it("should be routed to proper topic") {
- assertThat(result?.topic).isEqualTo("ves_trace")
+ assertThat(result.map(RoutedMessage::topic)).isEqualTo(Some("ves_trace"))
}
it("should be routed with a given message") {
- assertThat(result?.message).isSameAs(message)
+ assertThat(result.map(RoutedMessage::message)).isEqualTo(Some(message))
}
}
@@ -99,7 +102,7 @@ object RouterTest : Spek({
val result = cut.findDestination(message)
it("should not have route available") {
- assertThat(result).isNull()
+ assertThat(result).isEqualTo(None)
}
}
}