123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package sarama
- import "testing"
- var (
- alterPartitionReassignmentsResponseNoError = []byte{
- 0, 0, 39, 16,
- 0, 0,
- 0,
- 1,
- 0,
- }
- alterPartitionReassignmentsResponseWithError = []byte{
- 0, 0, 39, 16,
- 0, 12,
- 6, 101, 114, 114, 111, 114,
- 2,
- 6, 116, 111, 112, 105, 99,
- 2,
- 0, 0, 0, 1,
- 0, 3,
- 7, 101, 114, 114, 111, 114, 50,
- 0, 0, 0,
- }
- )
- func TestAlterPartitionReassignmentResponse(t *testing.T) {
- var response *AlterPartitionReassignmentsResponse
- response = &AlterPartitionReassignmentsResponse{
- ThrottleTimeMs: int32(10000),
- Version: int16(0),
- }
- testResponse(t, "no error", response, alterPartitionReassignmentsResponseNoError)
- errorMessage := "error"
- partitionError := "error2"
- response.ErrorCode = 12
- response.ErrorMessage = &errorMessage
- response.AddError("topic", 1, 3, &partitionError)
- testResponse(t, "with error", response, alterPartitionReassignmentsResponseWithError)
- }
|