Skip to content

Commit

Permalink
Update mock
Browse files Browse the repository at this point in the history
  • Loading branch information
shilgapira committed Mar 18, 2024
1 parent 0b5df83 commit 1fb2f72
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion descope/tests/mocks/mgmt/managementmock.go
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,10 @@ type MockProject struct {
ImportAssert func(req *descope.ImportProjectRequest)
ImportError error

ValidateImportAssert func(req *descope.ImportProjectRequest)
ValidateImportError error
ValidateImportResponse *descope.ValidateImportProjectResponse

UpdateNameAssert func(name string)
UpdateNameError error

Expand All @@ -1185,7 +1189,10 @@ func (m *MockProject) Import(_ context.Context, req *descope.ImportProjectReques
}

func (m *MockProject) ValidateImport(_ context.Context, req *descope.ImportProjectRequest) (*descope.ValidateImportProjectResponse, error) {
return nil, m.ImportError
if m.ValidateImportAssert != nil {
m.ValidateImportAssert(req)
}
return m.ValidateImportResponse, m.ValidateImportError
}

func (m *MockProject) UpdateName(_ context.Context, name string) error {
Expand Down

0 comments on commit 1fb2f72

Please sign in to comment.