| 1 |
package sarama |
| 2 |
|
| 3 |
import ( |
| 4 |
"testing" |
| 5 |
"time" |
| 6 |
) |
| 7 |
|
| 8 |
var ( |
| 9 |
addPartitionsToTxnResponse = []byte{ |
| 10 |
0, 0, 0, 100, |
| 11 |
0, 0, 0, 1, |
| 12 |
0, 5, 't', 'o', 'p', 'i', 'c', |
| 13 |
0, 0, 0, 1, |
| 14 |
0, 0, 0, 2, |
| 15 |
0, 48, |
| 16 |
} |
| 17 |
) |
| 18 |
|
| 19 |
func TestAddPartitionsToTxnResponse(t *testing.T) { |
| 20 |
resp := &AddPartitionsToTxnResponse{ |
| 21 |
ThrottleTime: 100 * time.Millisecond, |
| 22 |
Errors: map[string][]*PartitionError{ |
| 23 |
"topic": []*PartitionError{&PartitionError{ |
| 24 |
Err: ErrInvalidTxnState, |
| 25 |
Partition: 2, |
| 26 |
}}, |
| 27 |
}, |
| 28 |
} |
| 29 |
|
| 30 |
testResponse(t, "", resp, addPartitionsToTxnResponse) |
| 31 |
} |