From 1726b50690aace27ef80cc2fa0df1b1c94b9175b Mon Sep 17 00:00:00 2001 From: pputman-clabs Date: Sat, 7 Jan 2023 06:59:48 -0600 Subject: [PATCH] added find group by name --- mockokta.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mockokta.go b/mockokta.go index 48c8bed..9e5ce2e 100644 --- a/mockokta.go +++ b/mockokta.go @@ -162,6 +162,16 @@ func (g *GroupResource) GetGroupById(groupId string) (*okta.Group, error) { return nil, fmt.Errorf("group not found") } +func (g *GroupResource) GetGroupByName(groupName string) (*okta.Group, error) { + for _, group := range g.Groups { + if group.Name == groupName { + return group, nil + } + } + return nil, fmt.Errorf("group not found") +} + + type UserResource struct { Client *MockClient Users []*okta.User