(t *testing.T)
| 49 | ) |
| 50 | |
| 51 | func TestCreatePartitionsRequest(t *testing.T) { |
| 52 | req := &CreatePartitionsRequest{ |
| 53 | TopicPartitions: map[string]*TopicPartition{ |
| 54 | "topic": { |
| 55 | Count: 3, |
| 56 | }, |
| 57 | }, |
| 58 | Timeout: 100 * time.Millisecond, |
| 59 | } |
| 60 | |
| 61 | buf := testRequestEncode(t, "no assignment", req, createPartitionRequestNoAssignment) |
| 62 | testRequestDecode(t, "no assignment", req, buf) |
| 63 | |
| 64 | req.ValidateOnly = true |
| 65 | req.TopicPartitions["topic"].Assignment = [][]int32{{2, 3}, {3, 1}} |
| 66 | |
| 67 | buf = testRequestEncode(t, "assignment", req, createPartitionRequestAssignment) |
| 68 | testRequestDecode(t, "assignment", req, buf) |
| 69 | |
| 70 | req.Version = 2 |
| 71 | buf = testRequestEncode(t, "assignment v2", req, createPartitionRequestAssignmentV2) |
| 72 | testRequestDecode(t, "assignment v2", req, buf) |
| 73 | |
| 74 | // v3 wire format is identical to v2 |
| 75 | req.Version = 3 |
| 76 | buf = testRequestEncode(t, "assignment v3", req, createPartitionRequestAssignmentV2) |
| 77 | testRequestDecode(t, "assignment v3", req, buf) |
| 78 | } |
nothing calls this directly
no test coverage detected