Skip to content

Commit

Permalink
add go.uber.org/mock to tools.go, generate mocks using go run (#2080)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Nov 21, 2024
1 parent d327203 commit bc1accb
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 67 deletions.
8 changes: 4 additions & 4 deletions cas/cloudcas/cloudcas_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//go:generate mockgen -package cloudcas -mock_names=CertificateAuthorityClient=MockCertificateAuthorityClient -destination mock_client_test.go github.com/smallstep/certificates/cas/cloudcas CertificateAuthorityClient
//go:generate mockgen -package cloudcas -mock_names=OperationsServer=MockOperationsServer -destination mock_operation_server_test.go cloud.google.com/go/longrunning/autogen/longrunningpb OperationsServer
//go:generate go run go.uber.org/mock/mockgen -package cloudcas -mock_names=CertificateAuthorityClient=MockCertificateAuthorityClient -destination mock_client_test.go github.com/smallstep/certificates/cas/cloudcas CertificateAuthorityClient
//go:generate go run go.uber.org/mock/mockgen -package cloudcas -mock_names=OperationsServer=MockOperationsServer -destination mock_operation_server_test.go cloud.google.com/go/longrunning/autogen/longrunningpb OperationsServer

package cloudcas

Expand All @@ -26,12 +26,12 @@ import (
"cloud.google.com/go/longrunning/autogen/longrunningpb"
privateca "cloud.google.com/go/security/privateca/apiv1"
pb "cloud.google.com/go/security/privateca/apiv1/privatecapb"
gomock "github.com/golang/mock/gomock"
"github.com/google/uuid"
gax "github.com/googleapis/gax-go/v2"
"github.com/googleapis/gax-go/v2"
"github.com/pkg/errors"
"github.com/smallstep/certificates/cas/apiv1"
kmsapi "go.step.sm/crypto/kms/apiv1"
"go.uber.org/mock/gomock"
"google.golang.org/api/option"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
Expand Down
98 changes: 52 additions & 46 deletions cas/cloudcas/mock_client_test.go

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

18 changes: 12 additions & 6 deletions cas/cloudcas/mock_operation_server_test.go

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

Loading

0 comments on commit bc1accb

Please sign in to comment.