Merge "Extract transforming logic from validator"
diff --git a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt
index fe34a9c..fec713a 100644
--- a/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt
+++ b/sources/hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt
@@ -26,9 +26,9 @@
 import org.onap.dcae.collectors.veshv.boundary.SinkFactory
 import org.onap.dcae.collectors.veshv.config.api.model.Route
 import org.onap.dcae.collectors.veshv.config.api.model.Routing
-import org.onap.dcae.collectors.veshv.model.ClientContext
 import org.onap.dcae.collectors.veshv.domain.RoutedMessage
 import org.onap.dcae.collectors.veshv.domain.VesMessage
+import org.onap.dcae.collectors.veshv.model.ClientContext
 import org.onap.dcae.collectors.veshv.model.ConsumedMessage
 import org.onap.dcae.collectors.veshv.model.MessageDropCause
 import org.onap.dcae.collectors.veshv.utils.logging.Logger
@@ -43,12 +43,8 @@
                 sinkFactory: SinkFactory,
                 ctx: ClientContext,
                 metrics: Metrics) :
-            this(routing,
-                    constructMessageSinks(routing, sinkFactory, ctx),
-                    ctx,
-                    metrics) {
-        logger.debug(ctx::mdc) { "Routing for client: $routing" }
-        logger.trace(ctx::mdc) { "Message sinks configured for client: $messageSinks" }
+            this(routing, constructMessageSinks(routing, sinkFactory, ctx), ctx, metrics) {
+        logger.debug(ctx::mdc) { "Routing configuration for client: $routing" }
     }
 
     fun route(message: VesMessage): Flux<ConsumedMessage> =
diff --git a/sources/hv-collector-ves-message-generator/src/main/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/generators/RawMessageGenerator.kt b/sources/hv-collector-ves-message-generator/src/main/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/generators/RawMessageGenerator.kt
index 9f20bd2..3eeb634 100644
--- a/sources/hv-collector-ves-message-generator/src/main/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/generators/RawMessageGenerator.kt
+++ b/sources/hv-collector-ves-message-generator/src/main/kotlin/org/onap/dcae/collectors/veshv/ves/message/generator/generators/RawMessageGenerator.kt
@@ -19,6 +19,7 @@
  */
 package org.onap.dcae.collectors.veshv.ves.message.generator.generators
 
+import com.google.protobuf.ByteString
 import io.netty.buffer.Unpooled
 import org.onap.dcae.collectors.veshv.ves.message.generator.api.WireFrameParameters
 import org.onap.dcae.collectors.veshv.ves.message.generator.api.WireFrameType
@@ -45,10 +46,15 @@
 
     private fun createMessage(messageType: WireFrameType): ByteBuffer =
             when (messageType) {
-                INVALID_WIRE_FRAME -> wrap(VesEvent.getDefaultInstance().toByteArray())
+                INVALID_WIRE_FRAME -> wrap(constructSampleVesEvent().toByteArray())
                 INVALID_GPB_DATA -> wrap("invalid vesEvent".toByteArray(Charset.defaultCharset()))
             }
 
+    private fun constructSampleVesEvent() =
+            VesEvent.newBuilder()
+                    .setEventFields(ByteString.copyFromUtf8("irrelevant"))
+                    .build()
+
     private fun wrap(bytes: ByteArray) = Unpooled.wrappedBuffer(bytes).nioBuffer()