File tree 3 files changed +22
-1
lines changed
aws-lambda-java-events/src/main/java/com/amazonaws/services/lambda/runtime/events
aws-lambda-java-tests/src/test
java/com/amazonaws/services/lambda/runtime/tests
3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ public static class KafkaEventRecord {
42
42
private String timestampType ;
43
43
private String key ;
44
44
private String value ;
45
+ private List <Map <String , byte []>> headers ;
45
46
}
46
47
47
48
@ Data
Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ public void testLoadKafkaEvent() {
82
82
83
83
KafkaEvent .KafkaEventRecord record = event .getRecords ().get ("mytopic-01" ).get (0 );
84
84
assertThat (record .getValue ()).decodedAsBase64 ().asString ().isEqualTo ("Hello from Kafka !!" );
85
+
86
+ String headerValue = new String (record .getHeaders ().get (0 ).get ("headerKey" ));
87
+ assertThat (headerValue ).isEqualTo ("headerValue" );
85
88
}
86
89
87
90
@ Test
Original file line number Diff line number Diff line change 10
10
"offset" : 15 ,
11
11
"timestamp" : 1596480920837 ,
12
12
"timestampType" : " CREATE_TIME" ,
13
- "value" : " SGVsbG8gZnJvbSBLYWZrYSAhIQ=="
13
+ "value" : " SGVsbG8gZnJvbSBLYWZrYSAhIQ==" ,
14
+ "headers" : [
15
+ {
16
+ "headerKey" : [
17
+ 104 ,
18
+ 101 ,
19
+ 97 ,
20
+ 100 ,
21
+ 101 ,
22
+ 114 ,
23
+ 86 ,
24
+ 97 ,
25
+ 108 ,
26
+ 117 ,
27
+ 101
28
+ ]
29
+ }
30
+ ]
14
31
}
15
32
]
16
33
}
You can’t perform that action at this time.
0 commit comments