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

CLOUDP-193331: Atlas client mocks #1125

Merged
merged 16 commits into from
Sep 11, 2023
Merged
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/aws/aws-sdk-go v1.45.2
github.com/fatih/structtag v1.2.0
github.com/go-logr/zapr v1.2.4
github.com/go-test/deep v1.1.0
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.1
github.com/mongodb-forks/digest v1.0.5
Expand Down Expand Up @@ -45,7 +46,6 @@ require (
github.com/benbjohnson/clock v1.3.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/go-test/deep v1.1.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/s2a-go v0.1.5 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
Expand Down
8 changes: 5 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZ
cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
cloud.google.com/go v0.110.6 h1:8uYAkj3YHTP/1iwReuHPxLSbdcyc+dSBbzFMrVwDR6Q=
cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI=
cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
Expand Down Expand Up @@ -49,6 +50,7 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQ
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 h1:mLY+pNLjCUeKhgnAJWAKhEUQM+RJQo2H1fuGSw1Ky1E=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2/go.mod h1:FbdwsQ2EzwvXxOPcMFYO8ogEc9uMMIj3YkmCdXdAFmk=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.2.0 h1:8d4U82r7ItT1Es91x3eUcAQweih36KWvUha8AZ9X0Rs=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/keyvault/armkeyvault v1.2.0/go.mod h1:/1bkGperHinQbAHMWivoec/Ucu6//iXo6jn5mhmqCVU=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork/v2 v2.2.1 h1:bWh0Z2rOEDfB/ywv/l0iHN1JgyazE6kW/aIA89+CEK0=
Expand Down Expand Up @@ -123,6 +125,7 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U=
github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE=
github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE=
github.com/emicklei/go-restful/v3 v3.9.0 h1:XwGDlfxEnQZzuopoqxwSEllNcCOM9DhhFyhFIIGKwxE=
github.com/emicklei/go-restful/v3 v3.9.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
Expand Down Expand Up @@ -325,9 +328,6 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/onsi/ginkgo/v2 v2.12.0 h1:UIVDowFPwpg6yMUpPjGkYvf06K3RAiJXUhCxEwQVHRI=
github.com/onsi/ginkgo/v2 v2.12.0/go.mod h1:ZNEzXISYlqpb8S36iN71ifqLi3vVD1rVJGvWRCJOUpQ=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
Expand Down Expand Up @@ -421,6 +421,7 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
go.uber.org/goleak v1.2.0 h1:xqgm/S+aQvhWFTtR0XK3Jvg7z8kGV8P4X14IzwN3Eqk=
go.uber.org/goleak v1.2.0/go.mod h1:XJYK+MuIchqpmGmUSAzotztawfKvYLUIgg7guXrwVUo=
go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU=
go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=
go.uber.org/multierr v1.10.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
Expand Down Expand Up @@ -477,6 +478,7 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down
88 changes: 88 additions & 0 deletions internal/mocks/atlas/advanced_clusters.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package atlas

import (
"context"
"fmt"

"go.mongodb.org/atlas/mongodbatlas"
)

type AdvancedClustersClientMock struct {
ListFunc func(projectID string) (*mongodbatlas.AdvancedClustersResponse, *mongodbatlas.Response, error)
ListRequests map[string]struct{}

GetFunc func(projectID string, clusterName string) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error)
GetRequests map[string]struct{}

CreateFunc func(projectID string, cluster *mongodbatlas.AdvancedCluster) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error)
CreateRequests map[string]*mongodbatlas.AdvancedCluster

UpdateFunc func(projectID string, clusterName string, cluster *mongodbatlas.AdvancedCluster) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error)
UpdateRequests map[string]*mongodbatlas.AdvancedCluster

DeleteFunc func(projectID string, clusterName string) (*mongodbatlas.Response, error)
DeleteRequests map[string]struct{}

TestFailoverFunc func(projectID string, clusterName string) (*mongodbatlas.Response, error)
TestFailoverRequests map[string]struct{}
}

func (c *AdvancedClustersClientMock) List(_ context.Context, projectID string, _ *mongodbatlas.ListOptions) (*mongodbatlas.AdvancedClustersResponse, *mongodbatlas.Response, error) {
if c.ListRequests == nil {
c.ListRequests = map[string]struct{}{}
}

c.ListRequests[projectID] = struct{}{}

return c.ListFunc(projectID)
}

func (c *AdvancedClustersClientMock) Get(_ context.Context, projectID string, clusterName string) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error) {
if c.GetRequests == nil {
c.GetRequests = map[string]struct{}{}
}

c.GetRequests[fmt.Sprintf("%s.%s", projectID, clusterName)] = struct{}{}

return c.GetFunc(projectID, clusterName)
}

func (c *AdvancedClustersClientMock) Create(_ context.Context, projectID string, cluster *mongodbatlas.AdvancedCluster) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error) {
if c.CreateRequests == nil {
c.CreateRequests = map[string]*mongodbatlas.AdvancedCluster{}
}

c.CreateRequests[projectID] = cluster

return c.CreateFunc(projectID, cluster)
}

func (c *AdvancedClustersClientMock) Update(_ context.Context, projectID string, clusterName string, cluster *mongodbatlas.AdvancedCluster) (*mongodbatlas.AdvancedCluster, *mongodbatlas.Response, error) {
if c.UpdateRequests == nil {
c.UpdateRequests = map[string]*mongodbatlas.AdvancedCluster{}
}

c.UpdateRequests[fmt.Sprintf("%s.%s", projectID, clusterName)] = cluster

return c.UpdateFunc(projectID, clusterName, cluster)
}

func (c *AdvancedClustersClientMock) Delete(_ context.Context, projectID string, clusterName string, _ *mongodbatlas.DeleteAdvanceClusterOptions) (*mongodbatlas.Response, error) {
if c.DeleteRequests == nil {
c.DeleteRequests = map[string]struct{}{}
}

c.DeleteRequests[fmt.Sprintf("%s.%s", projectID, clusterName)] = struct{}{}

return c.DeleteFunc(projectID, clusterName)
}

func (c *AdvancedClustersClientMock) TestFailover(_ context.Context, projectID string, clusterName string) (*mongodbatlas.Response, error) {
if c.TestFailoverRequests == nil {
c.TestFailoverRequests = map[string]struct{}{}
}

c.TestFailoverRequests[fmt.Sprintf("%s.%s", projectID, clusterName)] = struct{}{}

return c.TestFailoverFunc(projectID, clusterName)
}
103 changes: 103 additions & 0 deletions internal/mocks/atlas/alert_configurations.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
package atlas

import (
"context"
"fmt"

"go.mongodb.org/atlas/mongodbatlas"
)

type AlertConfigurationsMock struct {
CreateFunc func(projectID string, alertConfig *mongodbatlas.AlertConfiguration) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
CreateRequests map[string]*mongodbatlas.AlertConfiguration

EnableAnAlertConfigFunc func(projectID string, alertConfigID string, enabled *bool) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
EnableAnAlertConfigRequests map[string]*bool

GetAnAlertConfigFunc func(projectID string, alertConfigID string) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
GetAnAlertConfigRequests map[string]struct{}

GetOpenAlertsConfigFunc func(projectID string, alertConfigID string) ([]mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
GetOpenAlertsConfigRequests map[string]struct{}

ListFunc func(projectID string) ([]mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
ListRequests map[string]struct{}

ListMatcherFieldsFunc func() ([]string, *mongodbatlas.Response, error)
ListMatcherFieldsCalls int

UpdateFunc func(projectID string, alertConfigID string, alertConfig *mongodbatlas.AlertConfiguration) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error)
UpdateRequests map[string]*mongodbatlas.AlertConfiguration

DeleteFunc func(projectID string, alertConfigID string) (*mongodbatlas.Response, error)
DeleteRequests map[string]struct{}
}

func (c *AlertConfigurationsMock) Create(_ context.Context, projectID string, alertConfig *mongodbatlas.AlertConfiguration) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.CreateRequests == nil {
c.CreateRequests = map[string]*mongodbatlas.AlertConfiguration{}
}

c.CreateRequests[projectID] = alertConfig

return c.CreateFunc(projectID, alertConfig)
}
func (c *AlertConfigurationsMock) EnableAnAlertConfig(_ context.Context, projectID string, alertConfigID string, enabled *bool) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.EnableAnAlertConfigRequests == nil {
c.EnableAnAlertConfigRequests = map[string]*bool{}
}

c.EnableAnAlertConfigRequests[fmt.Sprintf("%s.%s", projectID, alertConfigID)] = enabled

return c.EnableAnAlertConfigFunc(projectID, alertConfigID, enabled)
}
func (c *AlertConfigurationsMock) GetAnAlertConfig(_ context.Context, projectID string, alertConfigID string) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.GetAnAlertConfigRequests == nil {
c.GetAnAlertConfigRequests = map[string]struct{}{}
}

c.GetAnAlertConfigRequests[fmt.Sprintf("%s.%s", projectID, alertConfigID)] = struct{}{}

return c.GetAnAlertConfigFunc(projectID, alertConfigID)
}
func (c *AlertConfigurationsMock) GetOpenAlertsConfig(_ context.Context, projectID string, alertConfigID string) ([]mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.GetOpenAlertsConfigRequests == nil {
c.GetOpenAlertsConfigRequests = map[string]struct{}{}
}

c.GetOpenAlertsConfigRequests[fmt.Sprintf("%s.%s", projectID, alertConfigID)] = struct{}{}

return c.GetOpenAlertsConfigFunc(projectID, alertConfigID)
}
func (c *AlertConfigurationsMock) List(_ context.Context, projectID string, _ *mongodbatlas.ListOptions) ([]mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.ListRequests == nil {
c.ListRequests = map[string]struct{}{}
}

c.ListRequests[projectID] = struct{}{}

return c.ListFunc(projectID)
}
func (c *AlertConfigurationsMock) ListMatcherFields(_ context.Context) ([]string, *mongodbatlas.Response, error) {
c.ListMatcherFieldsCalls++

return c.ListMatcherFieldsFunc()
}
func (c *AlertConfigurationsMock) Update(_ context.Context, projectID string, alertConfigID string, alertConfig *mongodbatlas.AlertConfiguration) (*mongodbatlas.AlertConfiguration, *mongodbatlas.Response, error) {
if c.UpdateRequests == nil {
c.UpdateRequests = map[string]*mongodbatlas.AlertConfiguration{}
}

c.UpdateRequests[fmt.Sprintf("%s.%s", projectID, alertConfigID)] = alertConfig

return c.UpdateFunc(projectID, alertConfigID, alertConfig)
}
func (c *AlertConfigurationsMock) Delete(_ context.Context, projectID string, alertConfigID string) (*mongodbatlas.Response, error) {
if c.DeleteRequests == nil {
c.DeleteRequests = map[string]struct{}{}
}

c.DeleteRequests[fmt.Sprintf("%s.%s", projectID, alertConfigID)] = struct{}{}

return c.DeleteFunc(projectID, alertConfigID)
}
34 changes: 34 additions & 0 deletions internal/mocks/atlas/auditing.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package atlas

import (
"context"

"go.mongodb.org/atlas/mongodbatlas"
)

type AuditingClientMock struct {
GetFunc func(projectID string) (*mongodbatlas.Auditing, *mongodbatlas.Response, error)
GetRequests map[string]struct{}

ConfigureFunc func(projectID string, auditing *mongodbatlas.Auditing) (*mongodbatlas.Auditing, *mongodbatlas.Response, error)
ConfigureRequests map[string]*mongodbatlas.Auditing
}

func (c *AuditingClientMock) Get(_ context.Context, projectID string) (*mongodbatlas.Auditing, *mongodbatlas.Response, error) {
if c.GetRequests == nil {
c.GetRequests = map[string]struct{}{}
}

c.GetRequests[projectID] = struct{}{}

return c.GetFunc(projectID)
}
func (c *AuditingClientMock) Configure(_ context.Context, projectID string, auditing *mongodbatlas.Auditing) (*mongodbatlas.Auditing, *mongodbatlas.Response, error) {
if c.ConfigureRequests == nil {
c.ConfigureRequests = map[string]*mongodbatlas.Auditing{}
}

c.ConfigureRequests[projectID] = auditing

return c.ConfigureFunc(projectID, auditing)
}
74 changes: 74 additions & 0 deletions internal/mocks/atlas/cloud_provider_access.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package atlas

import (
"context"
"fmt"

"go.mongodb.org/atlas/mongodbatlas"
)

type CloudProviderAccessClientMock struct {
ListRolesFunc func(projectID string) (*mongodbatlas.CloudProviderAccessRoles, *mongodbatlas.Response, error)
ListRolesRequests map[string]struct{}

GetRoleFunc func(projectID string, roleID string) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error)
GetRoleRequests map[string]struct{}

CreateRoleFunc func(projectID string, cpa *mongodbatlas.CloudProviderAccessRoleRequest) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error)
CreateRoleRequests map[string]*mongodbatlas.CloudProviderAccessRoleRequest

AuthorizeRoleFunc func(projectID, roleID string, cpa *mongodbatlas.CloudProviderAccessRoleRequest) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error)
AuthorizeRoleRequests map[string]*mongodbatlas.CloudProviderAccessRoleRequest

DeauthorizeRoleFunc func(cpa *mongodbatlas.CloudProviderDeauthorizationRequest) (*mongodbatlas.Response, error)
DeauthorizeRoleRequests []*mongodbatlas.CloudProviderDeauthorizationRequest
}

func (c *CloudProviderAccessClientMock) ListRoles(_ context.Context, projectID string) (*mongodbatlas.CloudProviderAccessRoles, *mongodbatlas.Response, error) {
if c.ListRolesRequests == nil {
c.ListRolesRequests = map[string]struct{}{}
}

c.ListRolesRequests[projectID] = struct{}{}

return c.ListRolesFunc(projectID)
}

func (c *CloudProviderAccessClientMock) GetRole(_ context.Context, projectID string, roleID string) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error) {
if c.GetRoleRequests == nil {
c.GetRoleRequests = map[string]struct{}{}
}

c.GetRoleRequests[fmt.Sprintf("%s.%.s", projectID, roleID)] = struct{}{}

return c.GetRoleFunc(projectID, roleID)
}

func (c *CloudProviderAccessClientMock) CreateRole(_ context.Context, projectID string, cpa *mongodbatlas.CloudProviderAccessRoleRequest) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error) {
if c.CreateRoleRequests == nil {
c.CreateRoleRequests = map[string]*mongodbatlas.CloudProviderAccessRoleRequest{}
}

c.CreateRoleRequests[projectID] = cpa

return c.CreateRoleFunc(projectID, cpa)
}

func (c *CloudProviderAccessClientMock) AuthorizeRole(_ context.Context, projectID string, roleID string, cpa *mongodbatlas.CloudProviderAccessRoleRequest) (*mongodbatlas.CloudProviderAccessRole, *mongodbatlas.Response, error) {
if c.AuthorizeRoleRequests == nil {
c.AuthorizeRoleRequests = map[string]*mongodbatlas.CloudProviderAccessRoleRequest{}
}

c.AuthorizeRoleRequests[fmt.Sprintf("%s.%.s", projectID, roleID)] = cpa

return c.AuthorizeRoleFunc(projectID, roleID, cpa)
}
func (c *CloudProviderAccessClientMock) DeauthorizeRole(_ context.Context, cpa *mongodbatlas.CloudProviderDeauthorizationRequest) (*mongodbatlas.Response, error) {
if c.DeauthorizeRoleRequests == nil {
c.DeauthorizeRoleRequests = []*mongodbatlas.CloudProviderDeauthorizationRequest{}
}

c.DeauthorizeRoleRequests = append(c.DeauthorizeRoleRequests, cpa)

return c.DeauthorizeRoleFunc(cpa)
}
Loading
Loading