find_coordinator_request_test.go 733 B

123456789101112131415161718192021222324252627282930313233
  1. package sarama
  2. import "testing"
  3. var (
  4. findCoordinatorRequestConsumerGroup = []byte{
  5. 0, 5, 'g', 'r', 'o', 'u', 'p',
  6. 0,
  7. }
  8. findCoordinatorRequestTransaction = []byte{
  9. 0, 13, 't', 'r', 'a', 'n', 's', 'a', 'c', 't', 'i', 'o', 'n', 'i', 'd',
  10. 1,
  11. }
  12. )
  13. func TestFindCoordinatorRequest(t *testing.T) {
  14. req := &FindCoordinatorRequest{
  15. Version: 1,
  16. CoordinatorKey: "group",
  17. CoordinatorType: CoordinatorGroup,
  18. }
  19. testRequest(t, "version 1 - group", req, findCoordinatorRequestConsumerGroup)
  20. req = &FindCoordinatorRequest{
  21. Version: 1,
  22. CoordinatorKey: "transactionid",
  23. CoordinatorType: CoordinatorTransaction,
  24. }
  25. testRequest(t, "version 1 - transaction", req, findCoordinatorRequestTransaction)
  26. }