aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-core/src/test/kotlin
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-06-14 09:48:46 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-08-02 09:49:02 +0200
commit67689405071acdad2b26d5112b3662605e474ce9 (patch)
tree3e945129934d5721922fdabf229b0d61b772dfdb /hv-collector-core/src/test/kotlin
parente7987b7a660060746d5f49e1ec90b1ff90fcf55a (diff)
Various improvements
* Kotlin upgrade * Monad usage on APIs * Idle timeout * Simulator enhancements Closes ONAP-390 Change-Id: I3c00fcfe38c722caf661ddaad428cf089eeefcaa Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-core/src/test/kotlin')
-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)
}
}
}