Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Text File Validation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
memoriav
M
Memobase 2020
S
services
import-process
Text File Validation
Commits
8d787ebe
Commit
8d787ebe
authored
Sep 14, 2020
by
Jonas Waeber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
src/test/kotlin/Tests.kt
src/test/kotlin/Tests.kt
+6
-0
No files found.
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
Markdown
is supported
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