aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-dcae-app-simulator
diff options
context:
space:
mode:
authorPrzemyslaw Wasala <przemyslaw.wasala@nokia.com>2018-09-24 10:11:42 +0000
committerGerrit Code Review <gerrit@onap.org>2018-09-24 10:11:42 +0000
commit7b269674526a267f14895df8b825f3b59b30b98a (patch)
tree606cdabf7354c0d2a70aa2e0c63a1e36c0a76d1a /hv-collector-dcae-app-simulator
parent8f4a019fb04f0b3c408179ae1ae6daa9b742cdba (diff)
parente880cde732b6d5b6a2fd22b2245ba7f6ff4517f3 (diff)
Merge "Remove end-of-transmission message from protocol"
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()
}