diff options
author | 2019-04-10 09:31:15 +0000 | |
---|---|---|
committer | 2019-04-10 09:31:15 +0000 | |
commit | d52444107a3c62c1027e35178b76645ceb4d2c4e (patch) | |
tree | d0dbd57bc0f5a6e4387e74f1c00912ab8f2f98ee /sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt | |
parent | f864f9ae0cf8cef72b64cbda8964e86398b3f749 (diff) | |
parent | 735469d5003388df3622819c3d1db0e89a64197c (diff) |
Merge "Move maxPayloadSizeBytes to CollectorConfiguration"
Diffstat (limited to 'sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt')
-rw-r--r-- | sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt b/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt index 5fa1fd62..0806e8ca 100644 --- a/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt +++ b/sources/hv-collector-configuration/src/test/kotlin/org/onap/dcae/collectors/veshv/config/impl/ConfigurationValidatorTest.kt @@ -76,7 +76,6 @@ internal object ConfigurationValidatorTest : Spek({ val config = PartialConfiguration( listenPort = Some(defaultListenPort), idleTimeoutSec = Some(defaultIdleTimeoutSec), - maxPayloadSizeBytes = Some(defaultMaxPayloadSizeBytes), firstRequestDelaySec = Some(defaultFirstReqDelaySec), requestIntervalSec = Some(defaultRequestIntervalSec), sslDisable = Some(false), @@ -97,8 +96,6 @@ internal object ConfigurationValidatorTest : Spek({ { assertThat(it.server.listenPort) .isEqualTo(defaultListenPort) - assertThat(it.server.maxPayloadSizeBytes) - .isEqualTo(defaultMaxPayloadSizeBytes) assertThat(it.server.idleTimeout) .isEqualTo(Duration.ofSeconds(defaultIdleTimeoutSec)) @@ -116,6 +113,8 @@ internal object ConfigurationValidatorTest : Spek({ assertThat(it.collector.routing) .isEqualTo(sampleRouting) + assertThat(it.collector.maxPayloadSizeBytes) + .isEqualTo(sampleMaxPayloadSize) assertThat(it.logLevel).isEqualTo(LogLevel.TRACE) } @@ -183,7 +182,6 @@ internal object ConfigurationValidatorTest : Spek({ private fun partialConfiguration(listenPort: Option<Int> = Some(defaultListenPort), idleTimeoutSec: Option<Long> = Some(defaultIdleTimeoutSec), - maxPayloadSizeBytes: Option<Int> = Some(defaultMaxPayloadSizeBytes), firstReqDelaySec: Option<Long> = Some(defaultFirstReqDelaySec), requestIntervalSec: Option<Long> = Some(defaultRequestIntervalSec), sslDisable: Option<Boolean> = Some(false), @@ -196,7 +194,6 @@ private fun partialConfiguration(listenPort: Option<Int> = Some(defaultListenPor ) = PartialConfiguration( listenPort = listenPort, idleTimeoutSec = idleTimeoutSec, - maxPayloadSizeBytes = maxPayloadSizeBytes, firstRequestDelaySec = firstReqDelaySec, requestIntervalSec = requestIntervalSec, sslDisable = sslDisable, @@ -209,7 +206,6 @@ private fun partialConfiguration(listenPort: Option<Int> = Some(defaultListenPor ) const val defaultListenPort = 1234 -const val defaultMaxPayloadSizeBytes = 2 const val defaultRequestIntervalSec = 3L const val defaultIdleTimeoutSec = 10L const val defaultFirstReqDelaySec = 10L @@ -220,9 +216,12 @@ const val TRUSTSTORE = "trust.ks.pkcs12" const val TRUSTSTORE_PASSWORD = "changeMeToo" const val sampleSinkName = "perf3gpp" +const val sampleMaxPayloadSize = 1024 -private val sampleSink = mock<KafkaSink>().also { +private val sink = mock<KafkaSink>().also { whenever(it.name()).thenReturn(sampleSinkName) + whenever(it.maxPayloadSizeBytes()).thenReturn(sampleMaxPayloadSize) } -val sampleStreamsDefinition = listOf(sampleSink) -val sampleRouting = listOf(Route(sampleSink.name(), sampleSink))
\ No newline at end of file + +private val sampleStreamsDefinition = listOf(sink) +private val sampleRouting = listOf(Route(sink.name(), sink))
\ No newline at end of file |