Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
Import Process
Text File Validation
Commits
8d787ebe
Commit
8d787ebe
authored
Sep 14, 2020
by
Jonas Waeber
Browse files
Add basic test for header.
parent
ebd4cfb7
Pipeline
#14194
passed with stages
in 9 minutes and 36 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/test/kotlin/Tests.kt
View file @
8d787ebe
...
...
@@ -26,6 +26,7 @@ import java.util.stream.Stream
import
org.apache.kafka.clients.consumer.ConsumerConfig
import
org.apache.kafka.clients.consumer.ConsumerRecord
import
org.apache.kafka.clients.consumer.KafkaConsumer
import
org.apache.kafka.common.header.internals.RecordHeader
import
org.apache.kafka.common.serialization.StringDeserializer
import
org.apache.logging.log4j.LogManager
import
org.assertj.core.api.Assertions.assertThat
...
...
@@ -100,6 +101,7 @@ class Tests {
val
record
=
totalConsumerRecords
.
find
{
value
->
value
.
topic
()
==
topic
}
!!
val
recordKey
=
record
.
key
()
val
recordMessage
=
record
.
value
()
val
headers
=
record
.
headers
()
val
report
=
totalConsumerRecords
.
find
{
value
->
value
.
topic
()
==
reportingTopic
}
!!
val
reportKey
=
report
.
key
()
...
...
@@ -121,6 +123,10 @@ class Tests {
{
assertThat
(
reportMessage
)
.
isEqualTo
(
params
.
expectedReportValue
)
},
{
assertThat
(
headers
)
.
contains
(
RecordHeader
(
"sessionId"
,
"session1"
.
toByteArray
()))
}
)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment