list_partition_reassignments_response_test.go 988 B

1234567891011121314151617181920212223242526272829303132
  1. package sarama
  2. import "testing"
  3. var (
  4. listPartitionReassignmentsResponse = []byte{
  5. 0, 0, 39, 16, // ThrottleTimeMs 10000
  6. 0, 0, // errorcode
  7. 0, // null string
  8. 2, // block array length 1
  9. 6, 116, 111, 112, 105, 99, // topic name "topic"
  10. 2, // partition array length 1
  11. 0, 0, 0, 1, // partitionId
  12. 3, 0, 0, 3, 232, 0, 0, 3, 233, // replicas [1000, 1001]
  13. 3, 0, 0, 3, 234, 0, 0, 3, 235, // addingReplicas [1002, 1003]
  14. 3, 0, 0, 3, 236, 0, 0, 3, 237, // addingReplicas [1004, 1005]
  15. 0, 0, 0, // empty tagged fields
  16. }
  17. )
  18. func TestListPartitionReassignmentResponse(t *testing.T) {
  19. var response *ListPartitionReassignmentsResponse
  20. response = &ListPartitionReassignmentsResponse{
  21. ThrottleTimeMs: int32(10000),
  22. Version: int16(0),
  23. }
  24. response.AddBlock("topic", 1, []int32{1000, 1001}, []int32{1002, 1003}, []int32{1004, 1005})
  25. testResponse(t, "one topic", response, listPartitionReassignmentsResponse)
  26. }