acl_create_request_test.go 678 B

12345678910111213141516171819202122232425262728293031323334
  1. package sarama
  2. import "testing"
  3. var (
  4. aclCreateRequest = []byte{
  5. 0, 0, 0, 1,
  6. 3, // resource type = group
  7. 0, 5, 'g', 'r', 'o', 'u', 'p',
  8. 0, 9, 'p', 'r', 'i', 'n', 'c', 'i', 'p', 'a', 'l',
  9. 0, 4, 'h', 'o', 's', 't',
  10. 2, // all
  11. 2, // deny
  12. }
  13. )
  14. func TestCreateAclsRequest(t *testing.T) {
  15. req := &CreateAclsRequest{
  16. AclCreations: []*AclCreation{{
  17. Resource: Resource{
  18. ResourceType: AclResourceGroup,
  19. ResourceName: "group",
  20. },
  21. Acl: Acl{
  22. Principal: "principal",
  23. Host: "host",
  24. Operation: AclOperationAll,
  25. PermissionType: AclPermissionDeny,
  26. }},
  27. },
  28. }
  29. testRequest(t, "create request", req, aclCreateRequest)
  30. }