type mockAuthzHandler … func (mock *mockAuthzHandler) Authorize(ctx context.Context, a authorizer.Attributes) (authorizer.Decision, string, error) { … } func TestAuthorizationSecondPasses(t *testing.T) { … } func TestAuthorizationFirstPasses(t *testing.T) { … } func TestAuthorizationNonePasses(t *testing.T) { … } func TestAuthorizationError(t *testing.T) { … } type mockAuthzRuleHandler … func (mock *mockAuthzRuleHandler) RulesFor(ctx context.Context, user user.Info, namespace string) ([]authorizer.ResourceRuleInfo, []authorizer.NonResourceRuleInfo, bool, error) { … } func TestAuthorizationResourceRules(t *testing.T) { … } func TestAuthorizationNonResourceRules(t *testing.T) { … } func getResourceRules(infos []authorizer.ResourceRuleInfo) []authorizer.DefaultResourceRuleInfo { … } func getNonResourceRules(infos []authorizer.NonResourceRuleInfo) []authorizer.DefaultNonResourceRuleInfo { … } func TestAuthorizationUnequivocalDeny(t *testing.T) { … }