delete_topics_request_test.go 611 B

123456789101112131415161718192021222324252627282930313233
  1. package sarama
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. var deleteTopicsRequest = []byte{
  7. 0, 0, 0, 2,
  8. 0, 5, 't', 'o', 'p', 'i', 'c',
  9. 0, 5, 'o', 't', 'h', 'e', 'r',
  10. 0, 0, 0, 100,
  11. }
  12. func TestDeleteTopicsRequestV0(t *testing.T) {
  13. req := &DeleteTopicsRequest{
  14. Version: 0,
  15. Topics: []string{"topic", "other"},
  16. Timeout: 100 * time.Millisecond,
  17. }
  18. testRequest(t, "", req, deleteTopicsRequest)
  19. }
  20. func TestDeleteTopicsRequestV1(t *testing.T) {
  21. req := &DeleteTopicsRequest{
  22. Version: 1,
  23. Topics: []string{"topic", "other"},
  24. Timeout: 100 * time.Millisecond,
  25. }
  26. testRequest(t, "", req, deleteTopicsRequest)
  27. }