Skip to content

Commit

Permalink
chore: add profile mock
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwellgithinji committed Oct 6, 2021
1 parent cb63470 commit b1c60b8
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,16 @@ jobs:
go get github.com/fzipp/gocyclo
go get github.com/stretchr/testify/assert@v1.7.0
go get github.com/ory/go-acc
go get golang.org/x/oauth2/internal
go get google.golang.org/api/transport/http
go get google.golang.org/grpc
go get google.golang.org/grpc/internal/transport
go get cloud.google.com/go/monitoring/apiv3/v2
go get cloud.google.com/go/trace/apiv2
go get cloud.google.com/go/errorreporting
go get cloud.google.com/go/profiler
go get cloud.google.com/go/container/apiv1
- name: Run lint and test
run: |
staticcheck ./...
Expand Down
17 changes: 17 additions & 0 deletions mock/profile_mock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package mock

import (
"context"

"github.com/savannahghi/profileutils"
)

// FakeUserProfileRepository contains the profile repository mocks
type FakeUserProfileRepository struct {
GetLoggedInUserFn func(ctx context.Context) (*profileutils.UserInfo, error)
}

// GetLoggedInUser is a mock of GetLoggedInUser method
func (f *FakeUserProfileRepository) GetLoggedInUser(ctx context.Context) (*profileutils.UserInfo, error) {
return f.GetLoggedInUserFn(ctx)
}

0 comments on commit b1c60b8

Please sign in to comment.