diff --git a/internal/cmd/broker/delete_broker.go b/internal/cmd/broker/delete_broker.go index 9a9c0c72..13469675 100644 --- a/internal/cmd/broker/delete_broker.go +++ b/internal/cmd/broker/delete_broker.go @@ -19,13 +19,9 @@ package broker import ( "fmt" "io" - "net/http" "strings" "github.com/Peripli/service-manager-cli/internal/output" - "github.com/Peripli/service-manager-cli/pkg/errors" - - "github.com/Peripli/service-manager-cli/internal/util" "github.com/spf13/cobra" diff --git a/internal/cmd/label/label_test.go b/internal/cmd/label/label_test.go index cdeebd43..647be272 100644 --- a/internal/cmd/label/label_test.go +++ b/internal/cmd/label/label_test.go @@ -5,6 +5,9 @@ import ( "errors" "testing" + "io/ioutil" + "net/http" + "github.com/Peripli/service-manager-cli/internal/cmd" "github.com/Peripli/service-manager-cli/pkg/smclient/smclientfakes" "github.com/Peripli/service-manager-cli/pkg/types" @@ -13,14 +16,10 @@ import ( "github.com/Peripli/service-manager/pkg/web" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "io/ioutil" - "net/http" - "testing" ) func TestLabelCmd(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "") } var _ = Describe("Label Command test", func() { diff --git a/internal/cmd/offering/marketplace.go b/internal/cmd/offering/marketplace.go index 7029ba42..4ed0926c 100644 --- a/internal/cmd/offering/marketplace.go +++ b/internal/cmd/offering/marketplace.go @@ -83,6 +83,7 @@ func (m *MarketplaceCmd) Prepare(prepare cmd.PrepareFunc) *cobra.Command { cmd.AddFormatFlag(result.Flags()) result.Flags().StringVarP(&m.offering, "service", "s", "", "Plan details for a single service offering") + cmd.AddCommonQueryFlag(result.Flags(), &m.Parameters) return result } diff --git a/internal/cmd/offering/marketplace_test.go b/internal/cmd/offering/marketplace_test.go index 9bbc32f7..710bb85b 100644 --- a/internal/cmd/offering/marketplace_test.go +++ b/internal/cmd/offering/marketplace_test.go @@ -20,7 +20,6 @@ func TestMarketplaceCmd(t *testing.T) { } var _ = Describe("Marketplace command test", func() { - var client *smclientfakes.FakeClient var command *MarketplaceCmd var buffer *bytes.Buffer @@ -104,6 +103,22 @@ var _ = Describe("Marketplace command test", func() { }) }) + Context("when generic parameter is used", func() { + It("should pass it to SM", func() { + result := &types.Marketplace{ServiceOfferings: []types.ServiceOffering{noPlanOffering}} + client.MarketplaceReturns(result, nil) + param := "parameterKey=parameterValue" + err := executeWithArgs([]string{"--param", param}) + Expect(err).ShouldNot(HaveOccurred()) + + args := client.MarketplaceArgsForCall(0) + + Expect(args.GeneralParams).To(ConsistOf(param)) + Expect(args.FieldQuery).To(BeEmpty()) + Expect(args.LabelQuery).To(BeEmpty()) + }) + }) + Context("when service flag is used", func() { It("should list empty plans list when no plans provided", func() { result := &types.Marketplace{ServiceOfferings: []types.ServiceOffering{noPlanOffering}} diff --git a/internal/cmd/plan/list_plans.go b/internal/cmd/plan/list_plans.go index a2727e6b..9b8bd3cd 100644 --- a/internal/cmd/plan/list_plans.go +++ b/internal/cmd/plan/list_plans.go @@ -69,6 +69,7 @@ func (lp *ListPlansCmd) Prepare(prepare cmd.PrepareFunc) *cobra.Command { cmd.AddFormatFlag(result.Flags()) cmd.AddQueryingFlags(result.Flags(), &lp.Parameters) + cmd.AddCommonQueryFlag(result.Flags(), &lp.Parameters) return result } diff --git a/internal/cmd/plan/list_plans_test.go b/internal/cmd/plan/list_plans_test.go index f86f5ec0..2dadecd3 100644 --- a/internal/cmd/plan/list_plans_test.go +++ b/internal/cmd/plan/list_plans_test.go @@ -20,11 +20,12 @@ import ( "bytes" "encoding/json" "errors" + "testing" + "github.com/Peripli/service-manager-cli/internal/cmd" "github.com/Peripli/service-manager-cli/pkg/smclient/smclientfakes" "github.com/Peripli/service-manager-cli/pkg/types" "gopkg.in/yaml.v2" - "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -100,12 +101,28 @@ var _ = Describe("List plans command test", func() { }) }) + Context("when generic parameter is used", func() { + It("should pass it to SM", func() { + result := &types.ServicePlans{ServicePlans: []types.ServicePlan{plan1}} + client.ListPlansReturns(result, nil) + param := "parameterKey=parameterValue" + err := executeWithArgs([]string{"--param", param}) + Expect(err).ShouldNot(HaveOccurred()) + + args := client.ListPlansArgsForCall(0) + + Expect(args.GeneralParams).To(ConsistOf(param)) + Expect(args.FieldQuery).To(BeEmpty()) + Expect(args.LabelQuery).To(BeEmpty()) + }) + }) + Context("when field query flag is used", func() { It("should pass it to SM", func() { result := &types.ServicePlans{ServicePlans: []types.ServicePlan{plan1}} client.ListPlansReturns(result, nil) param := "name = plan1" - err := executeWithArgs([]string{"-f", param}) + err := executeWithArgs([]string{"--field-query", param}) args := client.ListPlansArgsForCall(0) @@ -120,7 +137,7 @@ var _ = Describe("List plans command test", func() { result := &types.ServicePlans{ServicePlans: []types.ServicePlan{plan1}} client.ListPlansReturns(result, nil) param := "test = false" - err := executeWithArgs([]string{"-l", param}) + err := executeWithArgs([]string{"--label-query", param}) args := client.ListPlansArgsForCall(0) diff --git a/internal/cmd/platform/delete_platform.go b/internal/cmd/platform/delete_platform.go index 9f56d45c..39ecda8f 100644 --- a/internal/cmd/platform/delete_platform.go +++ b/internal/cmd/platform/delete_platform.go @@ -19,7 +19,6 @@ package platform import ( "fmt" "io" - "net/http" "strings" "github.com/Peripli/service-manager-cli/internal/output" @@ -59,7 +58,7 @@ func (dpc *DeletePlatformCmd) Validate(args []string) error { func (dpc *DeletePlatformCmd) Run() error { dpc.Parameters.FieldQuery = append(dpc.Parameters.FieldQuery, fmt.Sprintf("name = %s", dpc.name)) - if err := dpc.Client.DeletePlatforms(&dpc.Parameters); err != nil { + if err := dpc.Client.DeletePlatforms(&dpc.Parameters); err != nil { if strings.Contains(err.Error(), "StatusCode: 404") { output.PrintMessage(dpc.Output, "Platform(s) not found.\n") return nil diff --git a/internal/cmd/visibility/delete_visibility.go b/internal/cmd/visibility/delete_visibility.go index c902ec2a..e2321e4b 100644 --- a/internal/cmd/visibility/delete_visibility.go +++ b/internal/cmd/visibility/delete_visibility.go @@ -19,9 +19,7 @@ package visibility import ( "fmt" "io" - "net/http" - - "github.com/Peripli/service-manager-cli/pkg/errors" + "strings" "github.com/Peripli/service-manager-cli/internal/cmd" "github.com/Peripli/service-manager-cli/internal/output" @@ -58,17 +56,15 @@ func (dv *DeleteVisibilityCmd) Validate(args []string) error { func (dv *DeleteVisibilityCmd) Run() error { dv.Parameters.FieldQuery = append(dv.Parameters.FieldQuery, fmt.Sprintf("id = %s", dv.id)) - err := dv.Client.DeleteVisibilities(&dv.Parameters) - - if respErr, ok := err.(errors.ResponseError); ok && respErr.StatusCode == http.StatusNotFound { - output.PrintMessage(dv.Output, "Visibility not found.\n") - return nil - } else if err != nil { + if err := dv.Client.DeleteVisibilities(&dv.Parameters); err != nil { + if strings.Contains(err.Error(), "StatusCode: 404") { + output.PrintMessage(dv.Output, "Visibility not found.\n") + return nil + } output.PrintMessage(dv.Output, "Could not delete visibility(s). Reason: ") return err } output.PrintMessage(dv.Output, "Visibility successfully deleted.\n") - return nil } diff --git a/internal/cmd/visibility/delete_visibility_test.go b/internal/cmd/visibility/delete_visibility_test.go index d186bd84..ff55ce7a 100644 --- a/internal/cmd/visibility/delete_visibility_test.go +++ b/internal/cmd/visibility/delete_visibility_test.go @@ -2,6 +2,8 @@ package visibility import ( "bytes" + + "io/ioutil" "net/http" "testing" @@ -10,9 +12,6 @@ import ( "github.com/Peripli/service-manager/pkg/util" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "io/ioutil" - "net/http" - "testing" ) func TestDeleteVisibilityCmd(t *testing.T) { diff --git a/pkg/smclient/client.go b/pkg/smclient/client.go index a1260a40..3636e8a6 100644 --- a/pkg/smclient/client.go +++ b/pkg/smclient/client.go @@ -20,11 +20,12 @@ import ( "bytes" "context" "encoding/json" - "github.com/Peripli/service-manager/pkg/util" "fmt" "io" "net/http" + "github.com/Peripli/service-manager/pkg/util" + "github.com/Peripli/service-manager/pkg/web" "github.com/Peripli/service-manager-cli/pkg/auth/oidc" @@ -57,8 +58,6 @@ type Client interface { UpdateVisibility(string, *types.Visibility, *query.Parameters) (*types.Visibility, error) DeleteVisibilities(*query.Parameters) error - ListOfferings(*query.Parameters) (*types.ServiceOfferings, error) - Label(string, string, *types.LabelChanges, *query.Parameters) error Marketplace(*query.Parameters) (*types.Marketplace, error) @@ -227,7 +226,7 @@ func (client *serviceManagerClient) Marketplace(q *query.Parameters) (*types.Mar } for i, so := range marketplace.ServiceOfferings { plans := &types.ServicePlansForOffering{} - err := client.list(&plans.ServicePlans, web.ServicePlansURL,&query.Parameters{ + err := client.list(&plans.ServicePlans, web.ServicePlansURL, &query.Parameters{ FieldQuery: []string{fmt.Sprintf("service_offering_id = %s", so.ID)}, GeneralParams: q.GeneralParams, }) @@ -237,7 +236,7 @@ func (client *serviceManagerClient) Marketplace(q *query.Parameters) (*types.Mar marketplace.ServiceOfferings[i].Plans = plans.ServicePlans broker := &types.Broker{} - err = client.list(broker, web.ServiceBrokersURL+"/"+so.BrokerID, &query.Parameters{ + err = client.get(broker, web.ServiceBrokersURL+"/"+so.BrokerID, &query.Parameters{ GeneralParams: q.GeneralParams, }) if err != nil { @@ -250,12 +249,12 @@ func (client *serviceManagerClient) Marketplace(q *query.Parameters) (*types.Mar } func (client *serviceManagerClient) list(result interface{}, url string, q *query.Parameters) error { - fullURL := httputil.NormalizeURL(client.config.URL) + path + fullURL := httputil.NormalizeURL(client.config.URL) + buildURL(url, q) return util.ListAll(context.Background(), client.httpClient.Do, fullURL, result) } func (client *serviceManagerClient) get(result interface{}, url string, q *query.Parameters) error { - resp, err := client.Call(http.MethodGet, path, nil, q) + resp, err := client.Call(http.MethodGet, url, nil, q) if err != nil { return err } diff --git a/pkg/smclient/client_test.go b/pkg/smclient/client_test.go index d7e9801c..3facfca7 100644 --- a/pkg/smclient/client_test.go +++ b/pkg/smclient/client_test.go @@ -35,7 +35,7 @@ type HandlerDetails struct { ResponseStatusCode int } -func TestSmClient(t *testing.T) { +func TestSMClient(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "") } @@ -119,7 +119,7 @@ var _ = Describe("Service Manager Client test", func() { } verifyErrorMsg := func(errorMsg, path string, body []byte, statusCode int) { - Expect(errorMsg).To(ContainSubstring(smServer.URL + path)) + Expect(errorMsg).To(ContainSubstring(buildURL(smServer.URL+path, params))) Expect(errorMsg).To(ContainSubstring(string(body))) Expect(errorMsg).To(ContainSubstring(fmt.Sprintf("StatusCode: %d", statusCode))) } @@ -668,7 +668,7 @@ var _ = Describe("Service Manager Client test", func() { } }) It("should return all with plans and broker name populated", func() { - result, err := client.Marketplace(nil) + result, err := client.Marketplace(params) Expect(err).ShouldNot(HaveOccurred()) Expect(result.ServiceOfferings).To(HaveLen(1)) Expect(result.ServiceOfferings[0]).To(Equal(*resultOffering)) @@ -685,7 +685,7 @@ var _ = Describe("Service Manager Client test", func() { } }) It("should return empty array", func() { - result, err := client.Marketplace(nil) + result, err := client.Marketplace(params) Expect(err).ShouldNot(HaveOccurred()) Expect(result.ServiceOfferings).To(HaveLen(0)) }) @@ -698,7 +698,7 @@ var _ = Describe("Service Manager Client test", func() { } }) It("should handle status code != 200", func() { - _, err := client.Marketplace(nil) + _, err := client.Marketplace(params) Expect(err).Should(HaveOccurred()) verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) @@ -711,7 +711,7 @@ var _ = Describe("Service Manager Client test", func() { } }) It("should handle status code > 299", func() { - _, err := client.Marketplace(nil) + _, err := client.Marketplace(params) Expect(err).Should(HaveOccurred()) verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) @@ -763,7 +763,7 @@ var _ = Describe("Service Manager Client test", func() { params.FieldQuery = append(params.FieldQuery, "id = id") err := client.DeleteBrokers(params) Expect(err).Should(HaveOccurred()) - verifyErrorMsg(err.Error(), handlerDetails[0].Path+"id", handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) + verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) }) }) @@ -796,7 +796,7 @@ var _ = Describe("Service Manager Client test", func() { params.FieldQuery = append(params.FieldQuery, "id = id") err := client.DeletePlatforms(params) Expect(err).Should(HaveOccurred()) - verifyErrorMsg(err.Error(), handlerDetails[0].Path+"id", handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) + verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) }) @@ -812,7 +812,7 @@ var _ = Describe("Service Manager Client test", func() { params.FieldQuery = append(params.FieldQuery, "id = id") err := client.DeletePlatforms(params) Expect(err).Should(HaveOccurred()) - verifyErrorMsg(err.Error(), handlerDetails[0].Path+"id", handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) + verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) }) }) @@ -845,7 +845,7 @@ var _ = Describe("Service Manager Client test", func() { params.FieldQuery = append(params.FieldQuery, "id = id") err := client.DeleteVisibilities(params) Expect(err).Should(HaveOccurred()) - verifyErrorMsg(err.Error(), handlerDetails[0].Path+"id", handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) + verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) }) @@ -861,7 +861,7 @@ var _ = Describe("Service Manager Client test", func() { params.FieldQuery = append(params.FieldQuery, "id = id") err := client.DeleteVisibilities(params) Expect(err).Should(HaveOccurred()) - verifyErrorMsg(err.Error(), handlerDetails[0].Path+"id", handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) + verifyErrorMsg(err.Error(), handlerDetails[0].Path, handlerDetails[0].ResponseBody, handlerDetails[0].ResponseStatusCode) }) }) }) diff --git a/pkg/smclient/smclientfakes/fake_client.go b/pkg/smclient/smclientfakes/fake_client.go index eeb80bb2..ed4f129f 100644 --- a/pkg/smclient/smclientfakes/fake_client.go +++ b/pkg/smclient/smclientfakes/fake_client.go @@ -114,6 +114,19 @@ type FakeClient struct { result1 *types.ServiceOfferings result2 error } + ListPlansStub func(*query.Parameters) (*types.ServicePlans, error) + listPlansMutex sync.RWMutex + listPlansArgsForCall []struct { + arg1 *query.Parameters + } + listPlansReturns struct { + result1 *types.ServicePlans + result2 error + } + listPlansReturnsOnCall map[int]struct { + result1 *types.ServicePlans + result2 error + } ListPlatformsStub func(*query.Parameters) (*types.Platforms, error) listPlatformsMutex sync.RWMutex listPlatformsArgsForCall []struct { @@ -140,6 +153,19 @@ type FakeClient struct { result1 *types.Visibilities result2 error } + MarketplaceStub func(*query.Parameters) (*types.Marketplace, error) + marketplaceMutex sync.RWMutex + marketplaceArgsForCall []struct { + arg1 *query.Parameters + } + marketplaceReturns struct { + result1 *types.Marketplace + result2 error + } + marketplaceReturnsOnCall map[int]struct { + result1 *types.Marketplace + result2 error + } RegisterBrokerStub func(*types.Broker, *query.Parameters) (*types.Broker, error) registerBrokerMutex sync.RWMutex registerBrokerArgsForCall []struct { @@ -729,6 +755,69 @@ func (fake *FakeClient) ListOfferingsReturnsOnCall(i int, result1 *types.Service }{result1, result2} } +func (fake *FakeClient) ListPlans(arg1 *query.Parameters) (*types.ServicePlans, error) { + fake.listPlansMutex.Lock() + ret, specificReturn := fake.listPlansReturnsOnCall[len(fake.listPlansArgsForCall)] + fake.listPlansArgsForCall = append(fake.listPlansArgsForCall, struct { + arg1 *query.Parameters + }{arg1}) + fake.recordInvocation("ListPlans", []interface{}{arg1}) + fake.listPlansMutex.Unlock() + if fake.ListPlansStub != nil { + return fake.ListPlansStub(arg1) + } + if specificReturn { + return ret.result1, ret.result2 + } + fakeReturns := fake.listPlansReturns + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeClient) ListPlansCallCount() int { + fake.listPlansMutex.RLock() + defer fake.listPlansMutex.RUnlock() + return len(fake.listPlansArgsForCall) +} + +func (fake *FakeClient) ListPlansCalls(stub func(*query.Parameters) (*types.ServicePlans, error)) { + fake.listPlansMutex.Lock() + defer fake.listPlansMutex.Unlock() + fake.ListPlansStub = stub +} + +func (fake *FakeClient) ListPlansArgsForCall(i int) *query.Parameters { + fake.listPlansMutex.RLock() + defer fake.listPlansMutex.RUnlock() + argsForCall := fake.listPlansArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeClient) ListPlansReturns(result1 *types.ServicePlans, result2 error) { + fake.listPlansMutex.Lock() + defer fake.listPlansMutex.Unlock() + fake.ListPlansStub = nil + fake.listPlansReturns = struct { + result1 *types.ServicePlans + result2 error + }{result1, result2} +} + +func (fake *FakeClient) ListPlansReturnsOnCall(i int, result1 *types.ServicePlans, result2 error) { + fake.listPlansMutex.Lock() + defer fake.listPlansMutex.Unlock() + fake.ListPlansStub = nil + if fake.listPlansReturnsOnCall == nil { + fake.listPlansReturnsOnCall = make(map[int]struct { + result1 *types.ServicePlans + result2 error + }) + } + fake.listPlansReturnsOnCall[i] = struct { + result1 *types.ServicePlans + result2 error + }{result1, result2} +} + func (fake *FakeClient) ListPlatforms(arg1 *query.Parameters) (*types.Platforms, error) { fake.listPlatformsMutex.Lock() ret, specificReturn := fake.listPlatformsReturnsOnCall[len(fake.listPlatformsArgsForCall)] @@ -855,6 +944,69 @@ func (fake *FakeClient) ListVisibilitiesReturnsOnCall(i int, result1 *types.Visi }{result1, result2} } +func (fake *FakeClient) Marketplace(arg1 *query.Parameters) (*types.Marketplace, error) { + fake.marketplaceMutex.Lock() + ret, specificReturn := fake.marketplaceReturnsOnCall[len(fake.marketplaceArgsForCall)] + fake.marketplaceArgsForCall = append(fake.marketplaceArgsForCall, struct { + arg1 *query.Parameters + }{arg1}) + fake.recordInvocation("Marketplace", []interface{}{arg1}) + fake.marketplaceMutex.Unlock() + if fake.MarketplaceStub != nil { + return fake.MarketplaceStub(arg1) + } + if specificReturn { + return ret.result1, ret.result2 + } + fakeReturns := fake.marketplaceReturns + return fakeReturns.result1, fakeReturns.result2 +} + +func (fake *FakeClient) MarketplaceCallCount() int { + fake.marketplaceMutex.RLock() + defer fake.marketplaceMutex.RUnlock() + return len(fake.marketplaceArgsForCall) +} + +func (fake *FakeClient) MarketplaceCalls(stub func(*query.Parameters) (*types.Marketplace, error)) { + fake.marketplaceMutex.Lock() + defer fake.marketplaceMutex.Unlock() + fake.MarketplaceStub = stub +} + +func (fake *FakeClient) MarketplaceArgsForCall(i int) *query.Parameters { + fake.marketplaceMutex.RLock() + defer fake.marketplaceMutex.RUnlock() + argsForCall := fake.marketplaceArgsForCall[i] + return argsForCall.arg1 +} + +func (fake *FakeClient) MarketplaceReturns(result1 *types.Marketplace, result2 error) { + fake.marketplaceMutex.Lock() + defer fake.marketplaceMutex.Unlock() + fake.MarketplaceStub = nil + fake.marketplaceReturns = struct { + result1 *types.Marketplace + result2 error + }{result1, result2} +} + +func (fake *FakeClient) MarketplaceReturnsOnCall(i int, result1 *types.Marketplace, result2 error) { + fake.marketplaceMutex.Lock() + defer fake.marketplaceMutex.Unlock() + fake.MarketplaceStub = nil + if fake.marketplaceReturnsOnCall == nil { + fake.marketplaceReturnsOnCall = make(map[int]struct { + result1 *types.Marketplace + result2 error + }) + } + fake.marketplaceReturnsOnCall[i] = struct { + result1 *types.Marketplace + result2 error + }{result1, result2} +} + func (fake *FakeClient) RegisterBroker(arg1 *types.Broker, arg2 *query.Parameters) (*types.Broker, error) { fake.registerBrokerMutex.Lock() ret, specificReturn := fake.registerBrokerReturnsOnCall[len(fake.registerBrokerArgsForCall)] @@ -1261,10 +1413,14 @@ func (fake *FakeClient) Invocations() map[string][][]interface{} { defer fake.listBrokersMutex.RUnlock() fake.listOfferingsMutex.RLock() defer fake.listOfferingsMutex.RUnlock() + fake.listPlansMutex.RLock() + defer fake.listPlansMutex.RUnlock() fake.listPlatformsMutex.RLock() defer fake.listPlatformsMutex.RUnlock() fake.listVisibilitiesMutex.RLock() defer fake.listVisibilitiesMutex.RUnlock() + fake.marketplaceMutex.RLock() + defer fake.marketplaceMutex.RUnlock() fake.registerBrokerMutex.RLock() defer fake.registerBrokerMutex.RUnlock() fake.registerPlatformMutex.RLock()