acl_describe_request_test.go 684 B

1234567891011121314151617181920212223242526272829303132333435
  1. package sarama
  2. import (
  3. "testing"
  4. )
  5. var (
  6. aclDescribeRequest = []byte{
  7. 2, // resource type
  8. 0, 5, 't', 'o', 'p', 'i', 'c',
  9. 0, 9, 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
  10. 0, 4, 'h', 'o', 's', 't',
  11. 5, // acl operation
  12. 3, // acl permission type
  13. }
  14. )
  15. func TestAclDescribeRequest(t *testing.T) {
  16. resourcename := "topic"
  17. principal := "principal"
  18. host := "host"
  19. req := &DescribeAclsRequest{
  20. AclFilter{
  21. ResourceType: AclResourceTopic,
  22. ResourceName: &resourcename,
  23. Principal: &principal,
  24. Host: &host,
  25. Operation: AclOperationCreate,
  26. PermissionType: AclPermissionAllow,
  27. },
  28. }
  29. testRequest(t, "", req, aclDescribeRequest)
  30. }