aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-dcae-app-simulator
diff options
context:
space:
mode:
Diffstat (limited to 'hv-collector-dcae-app-simulator')
-rw-r--r--hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/kafka/consumer.kt2
-rw-r--r--hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt2
-rw-r--r--hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/config/ArgBasedDcaeAppSimConfigurationTest.kt6
3 files changed, 4 insertions, 6 deletions
diff --git a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/kafka/consumer.kt b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/kafka/consumer.kt
index 7db69205..869c5ab6 100644
--- a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/kafka/consumer.kt
+++ b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/kafka/consumer.kt
@@ -67,7 +67,7 @@ class Consumer : ConsumerStateProvider {
}
}
-class ConsumerFactory(val kafkaBootstrapServers: String) {
+class ConsumerFactory(private val kafkaBootstrapServers: String) {
fun createConsumerForTopics(kafkaTopics: Set<String>): ConsumerStateProvider {
return KafkaSource.create(kafkaBootstrapServers, kafkaTopics.toSet()).start().unsafeRunSync()
}
diff --git a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt
index 39b4fe2f..d1d90b00 100644
--- a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt
+++ b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/remote/ApiServer.kt
@@ -54,7 +54,7 @@ class ApiServer(private val consumerFactory: ConsumerFactory) {
chain
.put("configuration/topics") { ctx ->
ctx.request.body.then { it ->
- val topics = extractTopics(it.getText())
+ val topics = extractTopics(it.text)
logger.info("Received new configuration. Creating consumer for topics: $topics")
consumerState = consumerFactory.createConsumerForTopics(topics)
ctx.response.contentType(CONTENT_TEXT)
diff --git a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/config/ArgBasedDcaeAppSimConfigurationTest.kt b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/config/ArgBasedDcaeAppSimConfigurationTest.kt
index b73a788e..4084ee8d 100644
--- a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/config/ArgBasedDcaeAppSimConfigurationTest.kt
+++ b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/config/ArgBasedDcaeAppSimConfigurationTest.kt
@@ -19,8 +19,6 @@
*/
package org.onap.dcae.collectors.veshv.simulators.dcaeapp.config
-import arrow.core.Failure
-import arrow.core.Success
import arrow.core.identity
import org.assertj.core.api.Assertions.assertThat
import org.jetbrains.spek.api.Spek
@@ -69,7 +67,7 @@ internal class ArgBasedDcaeAppSimConfigurationTest : Spek({
}
- it("should set proper kafka boostrap servers") {
+ it("should set proper kafka bootstrap servers") {
assertThat(result.kafkaBootstrapServers).isEqualTo(kafkaBootstrapServers)
}
@@ -92,7 +90,7 @@ internal class ArgBasedDcaeAppSimConfigurationTest : Spek({
assertThat(result.apiPort).isEqualTo(666)
}
- it("should set proper kafka boostrap servers") {
+ it("should set proper kafka bootstrap servers") {
assertThat(result.kafkaBootstrapServers).isEqualTo(kafkaBootstrapServers)
}