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

Function TestDecodingControlRecords

control_record_test.go:50–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

48}
49
50func TestDecodingControlRecords(t *testing.T) {
51 abortTx := testDecode(t, "abort transaction", abortTxCtrlRecKey, abortTxCtrlRecValue)
52
53 assertRecordType(t, &abortTx, ControlRecordAbort)
54
55 if abortTx.CoordinatorEpoch != 10 {
56 t.Errorf("abort tx control record coordinator epoch mismatch")
57 }
58
59 commitTx := testDecode(t, "commit transaction", commitTxCtrlRecKey, commitTxCtrlRecValue)
60
61 if commitTx.CoordinatorEpoch != 15 {
62 t.Errorf("commit tx control record coordinator epoch mismatch")
63 }
64 assertRecordType(t, &commitTx, ControlRecordCommit)
65
66 unknown := testDecode(t, "unknown", unknownCtrlRecKey, unknownCtrlRecValue)
67
68 assertRecordType(t, &unknown, ControlRecordUnknown)
69}

Callers

nothing calls this directly

Calls 3

testDecodeFunction · 0.85
assertRecordTypeFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected