- def convertedAvcEvent = jsonObjectMapper.convertJsonString(record.value(), AvcEvent)
- and: 'consumed forwarded NCMP event id differs from DMI event id'
- assert testEventSent.eventId != convertedAvcEvent.getEventId()
- and: 'correlation id matches'
- assert testEventSent.eventCorrelationId == convertedAvcEvent.getEventCorrelationId()
- and: 'timestamps match'
- assert testEventSent.eventTime == convertedAvcEvent.getEventTime()
- and: 'target matches'
- assert testEventSent.eventSource == convertedAvcEvent.getEventSource()
+ def convertedAvcEvent = jsonObjectMapper.convertJsonString(record.value(), AvcEvent.class)
+ and: 'we have correct headers forwarded where correlation id matches'
+ record.headers().forEach(header -> {
+ if (header.key().equals('eventCorrelationId')) {
+ assert SerializationUtils.deserialize(header.value()) == 'cmhandle1'
+ }
+ })
+ and: 'event id differs(as per requirement) between consumed and forwarded'
+ record.headers().forEach(header -> {
+ if (header.key().equals('eventId')) {
+ assert SerializationUtils.deserialize(header.value()) != 'sample-eventid'
+ }
+ })
+ and: 'the event payload still matches'
+ assert testEventSent == convertedAvcEvent