Skip to content

Commit 2442858

Browse files
ianpywPeiyu Wu
and
Peiyu Wu
authored
[Fix] Incorrect kafka example event and marshaling (#392)
* fix incorrect kafka test json * fix incorrect kafka test json 2/2 Co-authored-by: Peiyu Wu <[email protected]>
1 parent 85e7bc7 commit 2442858

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

events/kafka_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ func TestKafkaEventMarshaling(t *testing.T) {
3939
}
4040
}
4141
}
42+
43+
// 3. serialize to JSON
44+
outputJson, err := json.Marshal(inputEvent)
45+
if err != nil {
46+
t.Errorf("could not marshal event. details: %v", err)
47+
}
48+
49+
// 4. check result
50+
assert.JSONEq(t, string(inputJson), string(outputJson))
4251
}
4352

4453
func TestKafkaMarshalingMalformedJson(t *testing.T) {

events/testdata/kafka-event.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@
1414
"value": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj",
1515
"headers": [
1616
{
17-
"headerKey": [
18-
104,
19-
101,
20-
97,
21-
100,
22-
101,
23-
114,
24-
86,
25-
97,
26-
108,
27-
117,
28-
101
29-
]
17+
"headerKey": "aGVhZGVyVmFsdWU="
3018
}
3119
]
3220
}

0 commit comments

Comments
 (0)