aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-dcae-app-simulator
diff options
context:
space:
mode:
authorFilip Krzywka <filip.krzywka@nokia.com>2018-09-21 10:14:03 +0200
committerFilip Krzywka <filip.krzywka@nokia.com>2018-09-24 08:22:29 +0200
commite880cde732b6d5b6a2fd22b2245ba7f6ff4517f3 (patch)
tree256bd77a86bf86fce96979643a9fe5fcc0318aba /hv-collector-dcae-app-simulator
parent7333951cfec6b79a92b12e70cf679bff2f01825a (diff)
Remove end-of-transmission message from protocol
Also update protobuf files definitions to latest version. Change-Id: I0cd5d2d8deec5c787e2d3948d3d905fa672f9fea Issue-ID: DCAEGEN2-775 Signed-off-by: Filip Krzywka <filip.krzywka@nokia.com>
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/impl/MessageStreamValidation.kt4
-rw-r--r--hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulatorTest.kt2
-rw-r--r--hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidationTest.kt16
3 files changed, 11 insertions, 11 deletions
diff --git a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
index 51f94cc4..38de5370 100644
--- a/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
+++ b/hv-collector-dcae-app-simulator/src/main/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidation.kt
@@ -24,7 +24,7 @@ import arrow.effects.fix
import arrow.effects.monadError
import arrow.typeclasses.bindingCatch
import org.onap.dcae.collectors.veshv.domain.ByteData
-import org.onap.dcae.collectors.veshv.domain.PayloadWireFrameMessage
+import org.onap.dcae.collectors.veshv.domain.WireFrameMessage
import org.onap.dcae.collectors.veshv.utils.arrow.asIo
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageGenerator
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageParameters
@@ -77,7 +77,7 @@ class MessageStreamValidation(
private fun generateEvents(parameters: List<MessageParameters>): IO<List<VesEventOuterClass.VesEvent>> =
messageGenerator.createMessageFlux(parameters)
- .map(PayloadWireFrameMessage::payload)
+ .map(WireFrameMessage::payload)
.map(ByteData::unsafeAsArray)
.map(VesEventOuterClass.VesEvent::parseFrom)
.collectList()
diff --git a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulatorTest.kt b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulatorTest.kt
index 017360bb..34ec8f5a 100644
--- a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulatorTest.kt
+++ b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/DcaeAppSimulatorTest.kt
@@ -179,6 +179,6 @@ private fun vesEvent(eventId: String = DUMMY_EVENT_ID, payload: String = DUMMY_P
return VesEvent.newBuilder()
.setCommonEventHeader(CommonEventHeader.newBuilder()
.setEventId(eventId))
- .setHvMeasFields(ByteString.copyFrom(payload.toByteArray()))
+ .setEventFields(ByteString.copyFrom(payload.toByteArray()))
.build()
}
diff --git a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidationTest.kt b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidationTest.kt
index beef26b6..05fdd808 100644
--- a/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidationTest.kt
+++ b/hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/impl/MessageStreamValidationTest.kt
@@ -31,7 +31,7 @@ import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it
import org.mockito.ArgumentMatchers.anyList
-import org.onap.dcae.collectors.veshv.domain.PayloadWireFrameMessage
+import org.onap.dcae.collectors.veshv.domain.WireFrameMessage
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageGenerator
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageParameters
import org.onap.dcae.collectors.veshv.ves.message.generator.api.MessageParametersParser
@@ -89,7 +89,7 @@ internal class MessageStreamValidationTest : Spek({
// given
val jsonAsStream = sampleJsonAsStream()
val event = vesEvent()
- val generatedWireProtocolFrame = PayloadWireFrameMessage(event.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(event.toByteArray())
val receivedMessageBytes = event.toByteArray()
givenParsedMessageParameters(MessageParameters(event.commonEventHeader, MessageType.VALID, 1))
@@ -107,7 +107,7 @@ internal class MessageStreamValidationTest : Spek({
val jsonAsStream = sampleJsonAsStream()
val generatedEvent = vesEvent(payload = "payload A")
val receivedEvent = vesEvent(payload = "payload B")
- val generatedWireProtocolFrame = PayloadWireFrameMessage(generatedEvent.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(generatedEvent.toByteArray())
val receivedMessageBytes = receivedEvent.toByteArray()
givenParsedMessageParameters(MessageParameters(generatedEvent.commonEventHeader, MessageType.VALID, 1))
@@ -125,7 +125,7 @@ internal class MessageStreamValidationTest : Spek({
val jsonAsStream = sampleJsonAsStream()
val generatedEvent = vesEvent()
val receivedEvent = vesEvent(eventId = "bbb")
- val generatedWireProtocolFrame = PayloadWireFrameMessage(generatedEvent.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(generatedEvent.toByteArray())
val receivedMessageBytes = receivedEvent.toByteArray()
givenParsedMessageParameters(MessageParameters(generatedEvent.commonEventHeader, MessageType.VALID, 1))
@@ -144,7 +144,7 @@ internal class MessageStreamValidationTest : Spek({
// given
val jsonAsStream = sampleJsonAsStream()
val event = vesEvent()
- val generatedWireProtocolFrame = PayloadWireFrameMessage(event.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(event.toByteArray())
val receivedMessageBytes = event.toByteArray()
givenParsedMessageParameters(MessageParameters(event.commonEventHeader, MessageType.FIXED_PAYLOAD, 1))
@@ -162,7 +162,7 @@ internal class MessageStreamValidationTest : Spek({
val jsonAsStream = sampleJsonAsStream()
val generatedEvent = vesEvent(payload = "payload A")
val receivedEvent = vesEvent(payload = "payload B")
- val generatedWireProtocolFrame = PayloadWireFrameMessage(generatedEvent.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(generatedEvent.toByteArray())
val receivedMessageBytes = receivedEvent.toByteArray()
givenParsedMessageParameters(MessageParameters(generatedEvent.commonEventHeader, MessageType.FIXED_PAYLOAD, 1))
@@ -180,7 +180,7 @@ internal class MessageStreamValidationTest : Spek({
val jsonAsStream = sampleJsonAsStream()
val generatedEvent = vesEvent()
val receivedEvent = vesEvent("bbb")
- val generatedWireProtocolFrame = PayloadWireFrameMessage(generatedEvent.toByteArray())
+ val generatedWireProtocolFrame = WireFrameMessage(generatedEvent.toByteArray())
val receivedMessageBytes = receivedEvent.toByteArray()
givenParsedMessageParameters(MessageParameters(generatedEvent.commonEventHeader, MessageType.FIXED_PAYLOAD, 1))
@@ -205,7 +205,7 @@ private fun vesEvent(eventId: String = DUMMY_EVENT_ID, payload: String = DUMMY_P
return VesEvent.newBuilder()
.setCommonEventHeader(CommonEventHeader.newBuilder()
.setEventId(eventId))
- .setHvMeasFields(ByteString.copyFrom(payload.toByteArray()))
+ .setEventFields(ByteString.copyFrom(payload.toByteArray()))
.build()
}