github.com/streamdal/segmentio-kafka-go@v0.4.47-streamdal/protocol/endtxn/endtxn_test.go (about) 1 package endtxn_test 2 3 import ( 4 "testing" 5 6 "github.com/segmentio/kafka-go/protocol/endtxn" 7 "github.com/segmentio/kafka-go/protocol/prototest" 8 ) 9 10 func TestEndTxnRequest(t *testing.T) { 11 for _, version := range []int16{0, 1, 2, 3} { 12 prototest.TestRequest(t, version, &endtxn.Request{ 13 TransactionalID: "transactional-id-1", 14 ProducerID: 1, 15 ProducerEpoch: 100, 16 Committed: false, 17 }) 18 } 19 } 20 21 func TestEndTxnResponse(t *testing.T) { 22 for _, version := range []int16{0, 1, 2, 3} { 23 prototest.TestResponse(t, version, &endtxn.Response{ 24 ThrottleTimeMs: 1000, 25 ErrorCode: 4, 26 }) 27 } 28 }