diff options
Diffstat (limited to 'hv-collector-core/src/main/kotlin/org/onap')
3 files changed, 6 insertions, 7 deletions
diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt index 78afe9fd..8c16736d 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/AdapterFactory.kt @@ -36,6 +36,5 @@ object AdapterFactory { fun consulConfigurationProvider(configurationProviderParams: ConfigurationProviderParams): ConfigurationProvider = ConsulConfigurationProvider(httpAdapter(), configurationProviderParams) - fun httpAdapter(): HttpAdapter = HttpAdapter(HttpClient.create()) + private fun httpAdapter(): HttpAdapter = HttpAdapter(HttpClient.create()) } - diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt index 1672158e..bdce6f73 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt @@ -23,8 +23,6 @@ import io.netty.handler.codec.http.HttpStatusClass import org.slf4j.LoggerFactory import reactor.core.publisher.Mono import reactor.netty.http.client.HttpClient -import java.lang.IllegalStateException -import java.nio.charset.Charset /** * @author Jakub Dudycz <jakub.dudycz@nokia.com> @@ -40,8 +38,10 @@ open class HttpAdapter(private val httpClient: HttpClient) { .responseSingle { response, content -> if (response.status().codeClass() == HttpStatusClass.SUCCESS) content.asString() - else - Mono.error(IllegalStateException("$url ${response.status().code()} ${response.status().reasonPhrase()}")) + else { + val errorMessage = "$url ${response.status().code()} ${response.status().reasonPhrase()}" + Mono.error(IllegalStateException(errorMessage)) + } } .doOnError { logger.error("Failed to get resource on path: $url (${it.localizedMessage})") diff --git a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt index a42b982f..bab95c57 100644 --- a/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt +++ b/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/model/routing.kt @@ -75,7 +75,7 @@ class RouteBuilder { } fun withFixedPartitioning(num: Int = 0) { - partitioning = { _ -> num } + partitioning = { num } } fun build() = Route(domain, targetTopic, partitioning) |