MCPcopy Create free account
hub / github.com/IBM/sarama / assertMessageKey

Function assertMessageKey

consumer_test.go:2057–2064  ·  view source on GitHub ↗
(t *testing.T, msg *ConsumerMessage, expectedKey Encoder)

Source from the content-addressed store, hash-verified

2055}
2056
2057func assertMessageKey(t *testing.T, msg *ConsumerMessage, expectedKey Encoder) {
2058 t.Helper()
2059
2060 wantKey, _ := expectedKey.Encode()
2061 if !bytes.Equal(msg.Key, wantKey) {
2062 t.Fatalf("Incorrect key for message. expected=%s, actual=%s", expectedKey, msg.Key)
2063 }
2064}
2065
2066func assertMessageValue(t *testing.T, msg *ConsumerMessage, expectedValue Encoder) {
2067 t.Helper()

Callers 1

Calls 3

HelperMethod · 0.80
FatalfMethod · 0.80
EncodeMethod · 0.65

Tested by

no test coverage detected