From c2a30c5fdd6229ce98d6271b58f12582d7dc9dfe Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" Date: Thu, 21 Feb 2019 15:49:22 -0600 Subject: [PATCH] fix incorrect body of TestACLEndpoint_PolicyBatchRead Lifted from PR #5307 as it was an unrelated drive-by fix on that PR anyway. s/token/policy/ --- agent/consul/acl_endpoint_test.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/agent/consul/acl_endpoint_test.go b/agent/consul/acl_endpoint_test.go index ab44f634f2..f5963d49d3 100644 --- a/agent/consul/acl_endpoint_test.go +++ b/agent/consul/acl_endpoint_test.go @@ -1150,32 +1150,32 @@ func TestACLEndpoint_PolicyBatchRead(t *testing.T) { testrpc.WaitForLeader(t, s1.RPC, "dc1") - t1, err := upsertTestToken(codec, "root", "dc1") + p1, err := upsertTestPolicy(codec, "root", "dc1") require.NoError(t, err) - t2, err := upsertTestToken(codec, "root", "dc1") + p2, err := upsertTestPolicy(codec, "root", "dc1") require.NoError(t, err) acl := ACL{srv: s1} - tokens := []string{t1.AccessorID, t2.AccessorID} + policies := []string{p1.ID, p2.ID} - req := structs.ACLTokenBatchGetRequest{ + req := structs.ACLPolicyBatchGetRequest{ Datacenter: "dc1", - AccessorIDs: tokens, + PolicyIDs: policies, QueryOptions: structs.QueryOptions{Token: "root"}, } - resp := structs.ACLTokenBatchResponse{} + resp := structs.ACLPolicyBatchResponse{} - err = acl.TokenBatchRead(&req, &resp) + err = acl.PolicyBatchRead(&req, &resp) require.NoError(t, err) - var retrievedTokens []string + var retrievedPolicies []string - for _, v := range resp.Tokens { - retrievedTokens = append(retrievedTokens, v.AccessorID) + for _, v := range resp.Policies { + retrievedPolicies = append(retrievedPolicies, v.ID) } - require.EqualValues(t, retrievedTokens, tokens) + require.EqualValues(t, retrievedPolicies, policies) } func TestACLEndpoint_PolicySet(t *testing.T) {