File: endtxn_test.go

package info (click to toggle)
golang-github-segmentio-kafka-go 0.4.49%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,292 kB
  • sloc: sh: 17; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 612 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package endtxn_test

import (
	"testing"

	"github.com/segmentio/kafka-go/protocol/endtxn"
	"github.com/segmentio/kafka-go/protocol/prototest"
)

func TestEndTxnRequest(t *testing.T) {
	for _, version := range []int16{0, 1, 2, 3} {
		prototest.TestRequest(t, version, &endtxn.Request{
			TransactionalID: "transactional-id-1",
			ProducerID:      1,
			ProducerEpoch:   100,
			Committed:       false,
		})
	}
}

func TestEndTxnResponse(t *testing.T) {
	for _, version := range []int16{0, 1, 2, 3} {
		prototest.TestResponse(t, version, &endtxn.Response{
			ThrottleTimeMs: 1000,
			ErrorCode:      4,
		})
	}
}