Skip to content

Commit

Permalink
added find group by name
Browse files Browse the repository at this point in the history
  • Loading branch information
pputman-clabs committed Jan 7, 2023
1 parent 3e97904 commit 1726b50
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mockokta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1726b50

Please sign in to comment.