Skip to content

Commit

Permalink
add mock
Browse files Browse the repository at this point in the history
  • Loading branch information
talaharoni committed Apr 4, 2024
1 parent bb6fff4 commit b104e08
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions descope/tests/mocks/mgmt/managementmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,6 +1280,10 @@ type MockAuthz struct {
WhatCanTargetAccessResponse []*descope.AuthzRelation
WhatCanTargetAccessError error

WhatCanTargetAccessWithRelationAssert func(target string)
WhatCanTargetAccessWithRelationResponse []*descope.AuthzRelation
WhatCanTargetAccessWithRelationError error

GetModifiedAssert func(since time.Time)
GetModifiedResponse *descope.AuthzModified
GetModifiedError error
Expand Down Expand Up @@ -1384,6 +1388,13 @@ func (m *MockAuthz) WhatCanTargetAccess(_ context.Context, target string) ([]*de
return m.WhatCanTargetAccessResponse, m.WhatCanTargetAccessError
}

func (m *MockAuthz) WhatCanTargetAccessWithRelation(_ context.Context, target, relationDefinition, namespace string) ([]*descope.AuthzRelation, error) {

Check warning on line 1391 in descope/tests/mocks/mgmt/managementmock.go

View workflow job for this annotation

GitHub Actions / Lint and more checks

unused-parameter: parameter 'relationDefinition' seems to be unused, consider removing or renaming it as _ (revive)
if m.WhatCanTargetAccessWithRelationAssert != nil {
m.WhatCanTargetAccessWithRelationAssert(target)
}
return m.WhatCanTargetAccessWithRelationResponse, m.WhatCanTargetAccessWithRelationError
}

func (m *MockAuthz) GetModified(_ context.Context, since time.Time) (*descope.AuthzModified, error) {
if m.GetModifiedAssert != nil {
m.GetModifiedAssert(since)
Expand Down

0 comments on commit b104e08

Please sign in to comment.