Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: remove go mock #295

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"stscreds",
"syslist",
"Tracef",
"uber",
"unmarshalling",
"usrr",
"usrs",
Expand Down
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ go 1.23

require (
github.com/aws/aws-lambda-go v1.47.0
github.com/aws/aws-sdk-go-v2 v1.32.3
github.com/aws/aws-sdk-go-v2/config v1.28.1
github.com/aws/aws-sdk-go-v2/credentials v1.17.42
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.2
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.3
github.com/golang/mock v1.6.0
github.com/aws/aws-sdk-go-v2 v1.32.4
github.com/aws/aws-sdk-go-v2/config v1.28.2
github.com/aws/aws-sdk-go-v2/credentials v1.17.43
github.com/aws/aws-sdk-go-v2/service/s3 v1.66.3
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.34.4
github.com/google/go-cmp v0.6.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
go.uber.org/mock v0.5.0
golang.org/x/oauth2 v0.23.0
google.golang.org/api v0.204.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -26,18 +26,18 @@ require (
cloud.google.com/go/auth/oauth2adapt v0.2.5 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.6 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.18 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.22 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.19 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.23 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.22 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.23 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.3 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.4.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.4 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.24.4 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.32.4 // indirect
github.com/aws/smithy-go v1.22.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand Down Expand Up @@ -74,7 +74,7 @@ require (
golang.org/x/net v0.30.0 // indirect
golang.org/x/sys v0.26.0 // indirect
golang.org/x/text v0.19.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241021214115-324edc3d5d38 // indirect
google.golang.org/grpc v1.67.1 // indirect
google.golang.org/protobuf v1.35.1 // indirect
Expand Down
83 changes: 34 additions & 49 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/core/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/slashdevops/idp-scim-sync/internal/model"
)

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/core/idp_mocks.go -source=idp.go
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/core/idp_mocks.go -source=idp.go

// IdentityProviderService is the interface consumed by the core services and
// needs to be implemented by the Identity Provider service.
Expand Down
2 changes: 1 addition & 1 deletion internal/core/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"reflect"
"testing"

gomock "github.com/golang/mock/gomock"
mocks "github.com/slashdevops/idp-scim-sync/mocks/core"
"go.uber.org/mock/gomock"
)

func TestWithIdentityProviderGroupsFilter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/core/reconciling_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"errors"
"testing"

gomock "github.com/golang/mock/gomock"
"github.com/slashdevops/idp-scim-sync/internal/model"
mocks "github.com/slashdevops/idp-scim-sync/mocks/core"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
)

func TestReconcilingGroups(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/core/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/slashdevops/idp-scim-sync/internal/model"
)

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/core/repository_mocks.go -source=repository.go
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/core/repository_mocks.go -source=repository.go

// StateRepository is an interface for a repository that stores the state of the
// synchronization process.
Expand Down
2 changes: 1 addition & 1 deletion internal/core/scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/slashdevops/idp-scim-sync/internal/model"
)

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/core/scim_mocks.go -source=scim.go
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/core/scim_mocks.go -source=scim.go

// SCIMService is the interface that needs to be implemented by the
// SCIM Provider service.
Expand Down
2 changes: 1 addition & 1 deletion internal/core/sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"os"
"testing"

gomock "github.com/golang/mock/gomock"
"github.com/slashdevops/idp-scim-sync/internal/idp"
"github.com/slashdevops/idp-scim-sync/internal/model"
"github.com/slashdevops/idp-scim-sync/internal/repository"
Expand All @@ -18,6 +17,7 @@ import (
"github.com/slashdevops/idp-scim-sync/pkg/aws"
"github.com/slashdevops/idp-scim-sync/pkg/google"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
admin "google.golang.org/api/admin/directory/v1"
"google.golang.org/api/option"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/idp/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
ErrGroupResultNil = errors.New("provider: group result is nil")
)

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/idp/idp_mocks.go -source=idp.go GoogleProviderService
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/idp/idp_mocks.go -source=idp.go GoogleProviderService

// GoogleProviderService is the interface that wraps the Google Provider Service methods.
type GoogleProviderService interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/idp/idp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"errors"
"testing"

gomock "github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/slashdevops/idp-scim-sync/internal/model"
"go.uber.org/mock/gomock"

mocks "github.com/slashdevops/idp-scim-sync/mocks/idp"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion internal/repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/aws/aws-sdk-go-v2/service/s3"
)

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/repository/repository_mocks.go -source=repository.go
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/repository/repository_mocks.go -source=repository.go

// S3ClientAPI is an interface to consume S3 client methods
type S3ClientAPI interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/repository/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"

"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/golang/mock/gomock"
"github.com/slashdevops/idp-scim-sync/internal/model"
"go.uber.org/mock/gomock"

mocks "github.com/slashdevops/idp-scim-sync/mocks/repository"
"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion internal/scim/scim.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

// This implement core.SCIMService interface

//go:generate go run github.com/golang/mock/mockgen@v1.6.0 -package=mocks -destination=../../mocks/scim/scim_mocks.go -source=scim.go AWSSCIMProvider
//go:generate go run go.uber.org/mock/mockgen@v0.5.0 -package=mocks -destination=../../mocks/scim/scim_mocks.go -source=scim.go AWSSCIMProvider

// AWSSCIMProvider interface to consume aws package methods
type AWSSCIMProvider interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/scim/scim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"fmt"
"testing"

"github.com/golang/mock/gomock"
"github.com/slashdevops/idp-scim-sync/internal/model"
mocks "github.com/slashdevops/idp-scim-sync/mocks/scim"
"github.com/slashdevops/idp-scim-sync/pkg/aws"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
)

// groupMembersGenerator helper function to generate test data for GetGroupMembers
Expand Down
10 changes: 8 additions & 2 deletions mocks/aws/scim_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions mocks/aws/secretsmanager_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 12 additions & 6 deletions mocks/core/idp_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions mocks/core/repository_mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading