diff --git a/command/acl/acl_test.go b/command/acl/acl_test.go index 764fc35e7d..2095795ff0 100644 --- a/command/acl/acl_test.go +++ b/command/acl/acl_test.go @@ -72,15 +72,12 @@ func Test_GetPolicyIDFromPartial_Builtins(t *testing.T) { client := a.Client() client.AddHeader("X-Consul-Token", "root") - t.Run("global management policy", func(t *testing.T) { - id, err := GetPolicyIDFromPartial(client, structs.ACLPolicyGlobalManagementName) - require.NoError(t, err) - require.Equal(t, structs.ACLPolicyGlobalManagementID, id) - }) - - t.Run("global read-only policy", func(t *testing.T) { - id, err := GetPolicyIDFromPartial(client, structs.ACLPolicyGlobalReadOnlyName) - require.NoError(t, err) - require.Equal(t, structs.ACLPolicyGlobalReadOnlyID, id) - }) + for _, policy := range structs.ACLBuiltinPolicies { + name := fmt.Sprintf("%s policy", policy.Name) + t.Run(name, func(t *testing.T) { + id, err := GetPolicyIDFromPartial(client, policy.Name) + require.NoError(t, err) + require.Equal(t, policy.ID, id) + }) + } }