acl_delete_response_test.go 856 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package sarama
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. var (
  7. deleteAclsResponse = []byte{
  8. 0, 0, 0, 100,
  9. 0, 0, 0, 1,
  10. 0, 0, // no error
  11. 255, 255, // no error message
  12. 0, 0, 0, 1, // 1 matching acl
  13. 0, 0, // no error
  14. 255, 255, // no error message
  15. 2, // resource type
  16. 0, 5, 't', 'o', 'p', 'i', 'c',
  17. 0, 9, 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
  18. 0, 4, 'h', 'o', 's', 't',
  19. 4,
  20. 3,
  21. }
  22. )
  23. func TestDeleteAclsResponse(t *testing.T) {
  24. resp := &DeleteAclsResponse{
  25. ThrottleTime: 100 * time.Millisecond,
  26. FilterResponses: []*FilterResponse{{
  27. MatchingAcls: []*MatchingAcl{{
  28. Resource: Resource{ResourceType: AclResourceTopic, ResourceName: "topic"},
  29. Acl: Acl{Principal: "principal", Host: "host", Operation: AclOperationWrite, PermissionType: AclPermissionAllow},
  30. }},
  31. }},
  32. }
  33. testResponse(t, "", resp, deleteAclsResponse)
  34. }