Skip to content

Commit

Permalink
[Fix] Incorrect kafka example event and marshaling (#392)
Browse files Browse the repository at this point in the history
* fix incorrect kafka test json

* fix incorrect kafka test json 2/2

Co-authored-by: Peiyu Wu <[email protected]>
  • Loading branch information
ianpyw and Peiyu Wu authored Sep 17, 2021
1 parent 85e7bc7 commit 2442858
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
9 changes: 9 additions & 0 deletions events/kafka_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ func TestKafkaEventMarshaling(t *testing.T) {
}
}
}

// 3. serialize to JSON
outputJson, err := json.Marshal(inputEvent)
if err != nil {
t.Errorf("could not marshal event. details: %v", err)
}

// 4. check result
assert.JSONEq(t, string(inputJson), string(outputJson))
}

func TestKafkaMarshalingMalformedJson(t *testing.T) {
Expand Down
14 changes: 1 addition & 13 deletions events/testdata/kafka-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,7 @@
"value": "OGQ1NTk2YjQtMTgxMy00MjM4LWIyNGItNmRhZDhlM2QxYzBj",
"headers": [
{
"headerKey": [
104,
101,
97,
100,
101,
114,
86,
97,
108,
117,
101
]
"headerKey": "aGVhZGVyVmFsdWU="
}
]
}
Expand Down

0 comments on commit 2442858

Please sign in to comment.