diff options
author | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2019-04-03 12:12:17 +0200 |
---|---|---|
committer | Piotr Jaszczyk <piotr.jaszczyk@nokia.com> | 2019-04-03 12:12:17 +0200 |
commit | c7a3e0738abf581640059587dbb81790339340c9 (patch) | |
tree | 0c66b6b8a63391881e8d598f7c5348a936bb4abd /sources/hv-collector-ct/src | |
parent | 302d27926c76bb99eecc4f74d333d0e8ff240c6e (diff) |
Simplify factory/provider logic
Change-Id: I59467c41e1de63ead7c190a7c8fd688e3216237a
Issue-ID: DCAEGEN2-1385
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'sources/hv-collector-ct/src')
-rw-r--r-- | sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/Sut.kt | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/Sut.kt b/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/Sut.kt index 95b9159e..8b2bc13c 100644 --- a/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/Sut.kt +++ b/sources/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/Sut.kt @@ -19,17 +19,16 @@ */ package org.onap.dcae.collectors.veshv.tests.component -import arrow.effects.IO import io.netty.buffer.ByteBuf import io.netty.buffer.ByteBufAllocator import io.netty.buffer.UnpooledByteBufAllocator import org.onap.dcae.collectors.veshv.boundary.Collector import org.onap.dcae.collectors.veshv.boundary.Sink -import org.onap.dcae.collectors.veshv.boundary.SinkProvider +import org.onap.dcae.collectors.veshv.boundary.SinkFactory import org.onap.dcae.collectors.veshv.config.api.model.CollectorConfiguration import org.onap.dcae.collectors.veshv.config.api.model.Routing import org.onap.dcae.collectors.veshv.domain.RoutedMessage -import org.onap.dcae.collectors.veshv.factory.CollectorFactory +import org.onap.dcae.collectors.veshv.factory.HvVesCollectorFactory import org.onap.dcae.collectors.veshv.model.ClientContext import org.onap.dcae.collectors.veshv.tests.fakes.AlwaysFailingSink import org.onap.dcae.collectors.veshv.tests.fakes.AlwaysSuccessfulSink @@ -51,17 +50,15 @@ import java.util.concurrent.atomic.AtomicBoolean class Sut(configuration: CollectorConfiguration, sink: Sink = StoringSink()) : Closeable { val alloc: ByteBufAllocator = UnpooledByteBufAllocator.DEFAULT val metrics = FakeMetrics() - val sinkProvider = DummySinkProvider(sink) + val sinkProvider = DummySinkFactory(sink) - private val collectorFactory = CollectorFactory( + private val collectorProvider = HvVesCollectorFactory( configuration, sinkProvider, metrics, MAX_PAYLOAD_SIZE_BYTES ) - private val collectorProvider = collectorFactory.createVesHvCollectorProvider() - val collector: Collector get() = collectorProvider(ClientContext(alloc)) @@ -82,7 +79,7 @@ class Sut(configuration: CollectorConfiguration, sink: Sink = StoringSink()) : C } } -class DummySinkProvider(private val sink: Sink) : SinkProvider { +class DummySinkFactory(private val sink: Sink) : SinkFactory { private val sinkInitialized = AtomicBoolean(false) override fun invoke(stream: SinkStream, ctx: ClientContext) = lazy { |