diff options
author | fkrzywka <filip.krzywka@nokia.com> | 2018-07-16 08:17:29 +0200 |
---|---|---|
committer | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2018-08-03 07:09:48 +0200 |
commit | 2a8d4e37f01386c59379b9f974dddbf595ee0a18 (patch) | |
tree | 4c9d4170cb79fabd466cbf0c88fab3be3f46eebb /hv-collector-dcae-app-simulator | |
parent | c494575919fe88a050644766b152327bd433eaa6 (diff) |
Include msg generator module in coverage report
* Reordered alphabetically modules in main pom file
* Removed unused imports
* Corrected visibility for fields/methods
* Fix typos in tests
Change-Id: I35c515b3844bc8517cc6ffb0c6557596505536c9
Signed-off-by: fkrzywka <filip.krzywka@nokia.com>
Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-dcae-app-simulator')
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) } |