delete_records_response_test.go 741 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package sarama
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. var deleteRecordsResponse = []byte{
  7. 0, 0, 0, 100,
  8. 0, 0, 0, 2,
  9. 0, 5, 'o', 't', 'h', 'e', 'r',
  10. 0, 0, 0, 0,
  11. 0, 5, 't', 'o', 'p', 'i', 'c',
  12. 0, 0, 0, 2,
  13. 0, 0, 0, 19,
  14. 0, 0, 0, 0, 0, 0, 0, 200,
  15. 0, 0,
  16. 0, 0, 0, 20,
  17. 255, 255, 255, 255, 255, 255, 255, 255,
  18. 0, 3,
  19. }
  20. func TestDeleteRecordsResponse(t *testing.T) {
  21. resp := &DeleteRecordsResponse{
  22. Version: 0,
  23. ThrottleTime: 100 * time.Millisecond,
  24. Topics: map[string]*DeleteRecordsResponseTopic{
  25. "topic": {
  26. Partitions: map[int32]*DeleteRecordsResponsePartition{
  27. 19: {LowWatermark: 200, Err: 0},
  28. 20: {LowWatermark: -1, Err: 3},
  29. },
  30. },
  31. "other": {},
  32. },
  33. }
  34. testResponse(t, "", resp, deleteRecordsResponse)
  35. }