本文整理匯總了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeServiceBrokerRepo類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeServiceBrokerRepo類的具體用法?Golang FakeServiceBrokerRepo怎麽用?Golang FakeServiceBrokerRepo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeServiceBrokerRepo類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
"github.com/cloudfoundry/cli/cf/configuration/core_config"
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("update-service-broker command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.ReadWriter
serviceBrokerRepo *testapi.FakeServiceBrokerRepo
)
BeforeEach(func() {
configRepo = testconfig.NewRepositoryWithDefaults()
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{}
serviceBrokerRepo = &testapi.FakeServiceBrokerRepo{}
})
runCommand := func(args ...string) bool {
return testcmd.RunCommand(NewUpdateServiceBroker(ui, configRepo, serviceBrokerRepo), args, requirementsFactory)
}
示例2:
package actors_test
import (
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerRepo *fakes.FakeServiceBrokerRepo
serviceRepo *fakes.FakeServiceRepo
servicePlanRepo *fakes.FakeServicePlanRepo
servicePlanVisibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *fakes.FakeOrgRepository
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceRepo = &fakes.FakeServiceRepo{}
servicePlanRepo = &fakes.FakeServicePlanRepo{}
servicePlanVisibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &fakes.FakeOrgRepository{}
actor = actors.NewServiceHandler(brokerRepo, serviceRepo, servicePlanRepo, servicePlanVisibilityRepo, orgRepo)
serviceBroker1 := models.ServiceBroker{Guid: "my-service-broker-guid", Name: "my-service-broker"}
serviceBroker2 := models.ServiceBroker{Guid: "my-service-broker-guid2", Name: "my-service-broker2"}
示例3:
. "github.com/cloudfoundry/cli/cf/commands/servicebroker"
"github.com/cloudfoundry/cli/cf/configuration"
"github.com/cloudfoundry/cli/cf/models"
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-service-broker command", func() {
var (
ui *testterm.FakeUI
configRepo configuration.ReadWriter
brokerRepo *testapi.FakeServiceBrokerRepo
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{Inputs: []string{"y"}}
brokerRepo = &testapi.FakeServiceBrokerRepo{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
})
runCommand := func(args ...string) {
cmd := NewDeleteServiceBroker(ui, configRepo, brokerRepo)
testcmd.RunCommand(cmd, args, requirementsFactory)
}
示例4:
fake_service_builder "github.com/cloudfoundry/cli/cf/actors/service_builder/fakes"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Broker Builder", func() {
var (
brokerBuilder broker_builder.BrokerBuilder
serviceBuilder *fake_service_builder.FakeServiceBuilder
brokerRepo *fakes.FakeServiceBrokerRepo
serviceBroker1 models.ServiceBroker
services models.ServiceOfferings
service1 models.ServiceOffering
service2 models.ServiceOffering
service3 models.ServiceOffering
publicServicePlan models.ServicePlanFields
privateServicePlan models.ServicePlanFields
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceBuilder = &fake_service_builder.FakeServiceBuilder{}
brokerBuilder = broker_builder.NewBuilder(brokerRepo, serviceBuilder)
serviceBroker1 = models.ServiceBroker{Guid: "my-service-broker-guid", Name: "my-service-broker"}
示例5:
import (
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerRepo *fakes.FakeServiceBrokerRepo
serviceRepo *fakes.FakeServiceRepo
servicePlanRepo *fakes.FakeServicePlanRepo
servicePlanVisibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *fakes.FakeOrgRepository
serviceBroker1 models.ServiceBroker
serviceBroker2 models.ServiceBroker
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceRepo = &fakes.FakeServiceRepo{}
servicePlanRepo = &fakes.FakeServicePlanRepo{}
servicePlanVisibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &fakes.FakeOrgRepository{}
actor = actors.NewServiceHandler(brokerRepo, serviceRepo, servicePlanRepo, servicePlanVisibilityRepo, orgRepo)
serviceBroker1 = models.ServiceBroker{Guid: "my-service-broker-guid", Name: "my-service-broker"}
示例6:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"strings"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("service-brokers command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
repo *testapi.FakeServiceBrokerRepo
requirementsFactory *testreq.FakeReqFactory
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceBrokerRepository(repo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("service-brokers").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
repo = &testapi.FakeServiceBrokerRepo{}
示例7:
package actors_test
import (
"github.com/cloudfoundry/cli/cf/actors"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Services", func() {
var (
actor actors.ServiceActor
brokerRepo *fakes.FakeServiceBrokerRepo
serviceRepo *fakes.FakeServiceRepo
servicePlanRepo *fakes.FakeServicePlanRepo
servicePlanVisibilityRepo *fakes.FakeServicePlanVisibilityRepository
orgRepo *fakes.FakeOrgRepository
)
BeforeEach(func() {
brokerRepo = &fakes.FakeServiceBrokerRepo{}
serviceRepo = &fakes.FakeServiceRepo{}
servicePlanRepo = &fakes.FakeServicePlanRepo{}
servicePlanVisibilityRepo = &fakes.FakeServicePlanVisibilityRepository{}
orgRepo = &fakes.FakeOrgRepository{}
actor = actors.NewServiceHandler(brokerRepo, serviceRepo, servicePlanRepo, servicePlanVisibilityRepo, orgRepo)
})
Describe("Get Brokers with Dependencies", func() {