From 77a48cda7c647823302192cd032efd063e500ddc Mon Sep 17 00:00:00 2001 From: pputman-clabs Date: Sun, 8 Jan 2023 01:18:24 -0600 Subject: [PATCH] fixed deletegroup function to match interface --- mockokta.go | 8 ++++---- mockokta_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mockokta.go b/mockokta.go index e164f5b..03536fe 100644 --- a/mockokta.go +++ b/mockokta.go @@ -55,7 +55,7 @@ func (client *MockClient) CreateGroup(ctx context.Context, group okta.Group) (*o return client.Group.CreateGroup(ctx, group) } -func (client *MockClient) DeleteGroup(ctx context.Context, groupId string) error { +func (client *MockClient) DeleteGroup(ctx context.Context, groupId string) (*okta.Response, error) { return client.Group.DeleteGroup(ctx, groupId) } @@ -75,17 +75,17 @@ func (client *MockClient) RemoveUserFromGroup(ctx context.Context, groupId strin return client.Group.RemoveUserFromGroup(ctx, groupId, userId) } -func (g *GroupResource) DeleteGroup(ctx context.Context, groupId string) error { +func (g *GroupResource) DeleteGroup(ctx context.Context, groupId string) (*okta.Response, error) { for idx, group := range g.Groups { if group.Id == groupId { g.Groups[idx] = g.Groups[len(g.Groups)-1] g.Groups[len(g.Groups)-1] = &okta.Group{} g.Groups = g.Groups[:len(g.Groups)-1] - return nil + return nil, nil } } - return fmt.Errorf("group not found") + return nil, fmt.Errorf("group not found") } func (g *GroupResource) CreateGroup(ctx context.Context, group okta.Group) (*okta.Group, *okta.Response, error) { diff --git a/mockokta_test.go b/mockokta_test.go index a93edfa..0aa6770 100644 --- a/mockokta_test.go +++ b/mockokta_test.go @@ -320,7 +320,7 @@ func TestGroupResource_DeleteGroup(t *testing.T) { client := NewClient() - err := client.Group.DeleteGroup(context.TODO(), groupIdArg) + _, err := client.Group.DeleteGroup(context.TODO(), groupIdArg) if err == nil { t.Errorf("expected error but didn't get one")