本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/fakes.FakeServiceRepo类的典型用法代码示例。如果您正苦于以下问题:Golang FakeServiceRepo类的具体用法?Golang FakeServiceRepo怎么用?Golang FakeServiceRepo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeServiceRepo类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1:
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"}
开发者ID:EthanWu,项目名称:cli,代码行数:32,代码来源:services_test.go
示例2:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/servicekey"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("service-keys command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
cmd *ServiceKeys
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepo
serviceKeyRepo *testapi.FakeServiceKeyRepo
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
serviceRepo = &testapi.FakeServiceRepo{}
serviceInstance := models.ServiceInstance{}
serviceInstance.Guid = "fake-instance-guid"
serviceRepo.FindInstanceByNameMap = generic.NewMap()
serviceRepo.FindInstanceByNameMap.Set("fake-service-instance", serviceInstance)
serviceKeyRepo = testapi.NewFakeServiceKeyRepo()
cmd = NewListServiceKeys(ui, config, serviceRepo, serviceKeyRepo)
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true, ServiceInstanceNotFound: false}
开发者ID:lemaral,项目名称:Wildcard_Plugin,代码行数:32,代码来源:service_keys_test.go
示例3:
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Push Command", func() {
var (
cmd *Push
ui *testterm.FakeUI
configRepo configuration.ReadWriter
manifestRepo *testmanifest.FakeManifestRepository
starter *testcmd.FakeAppStarter
stopper *testcmd.FakeAppStopper
serviceBinder *testcmd.FakeAppBinder
appRepo *testapi.FakeApplicationRepository
domainRepo *testapi.FakeDomainRepository
routeRepo *testapi.FakeRouteRepository
stackRepo *testapi.FakeStackRepository
serviceRepo *testapi.FakeServiceRepo
wordGenerator words.WordGenerator
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
actor *fakeactors.FakePushActor
app_files *fakeappfiles.FakeAppFiles
zipper *fakeappfiles.FakeZipper
)
BeforeEach(func() {
manifestRepo = &testmanifest.FakeManifestRepository{}
starter = &testcmd.FakeAppStarter{}
stopper = &testcmd.FakeAppStopper{}
serviceBinder = &testcmd.FakeAppBinder{}
开发者ID:matanzit,项目名称:cli,代码行数:32,代码来源:push_test.go
示例4:
"github.com/cloudfoundry/cli/cf/actors/service_builder"
testapi "github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Service Builder", func() {
var (
planBuilder *plan_builder_fakes.FakePlanBuilder
serviceBuilder service_builder.ServiceBuilder
serviceRepo *testapi.FakeServiceRepo
service1 models.ServiceOffering
service2 models.ServiceOffering
v1Service models.ServiceOffering
planWithoutOrgs models.ServicePlanFields
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
plan3 models.ServicePlanFields
)
BeforeEach(func() {
serviceRepo = &testapi.FakeServiceRepo{}
planBuilder = &plan_builder_fakes.FakePlanBuilder{}
serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
Guid: "service-guid1",
开发者ID:tools-alexuser01,项目名称:cli,代码行数:32,代码来源:service_builder_test.go
示例5:
"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 command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepo
planBuilder *testplanbuilder.FakePlanBuilder
offering1 models.ServiceOffering
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
config.SetApiVersion("2.26.0")
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
serviceRepo = &testapi.FakeServiceRepo{}
planBuilder = &testplanbuilder.FakePlanBuilder{}
offering1 = models.ServiceOffering{}
offering1.Label = "cleardb"
offering1.Plans = []models.ServicePlanFields{{
开发者ID:tools-alexuser01,项目名称:cli,代码行数:32,代码来源:update_service_test.go
示例6:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/cf/commands/servicekey"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("delete-service-key command", func() {
var (
ui *testterm.FakeUI
config core_config.Repository
cmd *DeleteServiceKey
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepo
serviceKeyRepo *testapi.FakeServiceKeyRepo
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
serviceRepo = &testapi.FakeServiceRepo{}
serviceInstance := models.ServiceInstance{}
serviceInstance.Guid = "fake-service-instance-guid"
serviceRepo.FindInstanceByNameMap = generic.NewMap()
serviceRepo.FindInstanceByNameMap.Set("fake-service-instance", serviceInstance)
serviceKeyRepo = testapi.NewFakeServiceKeyRepo()
cmd = NewDeleteServiceKey(ui, config, serviceRepo, serviceKeyRepo)
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
开发者ID:yousk520,项目名称:cli,代码行数:32,代码来源:delete_service_key_test.go
示例7:
import (
plan_builder_fakes "github.com/cloudfoundry/cli/cf/actors/plan_builder/fakes"
"github.com/cloudfoundry/cli/cf/actors/service_builder"
"github.com/cloudfoundry/cli/cf/api/fakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Service Builder", func() {
var (
planBuilder *plan_builder_fakes.FakePlanBuilder
serviceBuilder service_builder.ServiceBuilder
serviceRepo *fakes.FakeServiceRepo
service1 models.ServiceOffering
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
)
BeforeEach(func() {
serviceRepo = &fakes.FakeServiceRepo{}
planBuilder = &plan_builder_fakes.FakePlanBuilder{}
serviceBuilder = service_builder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
Guid: "service-guid1",
BrokerGuid: "my-service-broker-guid1",
},
开发者ID:Jack1996,项目名称:cli,代码行数:31,代码来源:service_builder_test.go
示例8:
"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("delete-service command", func() {
var (
ui *testterm.FakeUI
requirementsFactory *testreq.FakeReqFactory
serviceRepo *testapi.FakeServiceRepo
serviceInstance models.ServiceInstance
configRepo core_config.Repository
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = configRepo
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
开发者ID:0976254669,项目名称:cli,代码行数:32,代码来源:delete_service_test.go
示例9:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
"github.com/cloudfoundry/cli/testhelpers/maker"
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("purge-service-instance command", func() {
var (
requirementsFactory *testreq.FakeReqFactory
config core_config.Repository
ui *testterm.FakeUI
serviceRepo *testapi.FakeServiceRepo
deps command_registry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.Ui = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("purge-service-instance").SetDependency(deps, pluginCall))
}
runCommand := func(args []string) bool {
return testcmd.RunCliCommand("purge-service-instance", args, requirementsFactory, updateCommandDependency, false)
}
开发者ID:Ganesh160890,项目名称:cli,代码行数:30,代码来源:purge_service_instance_test.go
示例10:
"github.com/cloudfoundry/cli/cf/errors"
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("migrating service instances from v1 to v2", func() {
var (
ui *testterm.FakeUI
serviceRepo *testapi.FakeServiceRepo
cmd *MigrateServiceInstances
requirementsFactory *testreq.FakeReqFactory
args []string
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config := testconfig.NewRepository()
serviceRepo = &testapi.FakeServiceRepo{}
cmd = NewMigrateServiceInstances(ui, config, serviceRepo)
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: false}
args = []string{}
})
Describe("requirements", func() {
It("requires you to be logged in", func() {
开发者ID:tools-alexuser01,项目名称:cli,代码行数:31,代码来源:migrate_service_instances_test.go
注:本文中的github.com/cloudfoundry/cli/cf/api/fakes.FakeServiceRepo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论