本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/api/apifakes.FakeServiceRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeServiceRepository类的具体用法?Golang FakeServiceRepository怎么用?Golang FakeServiceRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeServiceRepository类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
"github.com/cloudfoundry/cli/cf/commandregistry"
. "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 coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
serviceKeyRepo *apifakes.OldFakeServiceKeyRepo
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.RepoLocator = deps.RepoLocator.SetServiceKeyRepository(serviceKeyRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service-key").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
示例2:
"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 *apifakes.FakeServiceRepository
config coreconfig.Repository
requirementsFactory *testreq.FakeReqFactory
args []string
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("migrate-service-instances").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepository()
serviceRepo = new(apifakes.FakeServiceRepository)
示例3:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/commands/service"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("update-service command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
planBuilder *planbuilderfakes.FakePlanBuilder
offering1 models.ServiceOffering
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
deps.PlanBuilder = planBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("update-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
示例4:
"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 *apifakes.FakeServiceRepository
serviceInstance models.ServiceInstance
configRepo coreconfig.Repository
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = configRepo
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{
Inputs: []string{"yes"},
}
示例5:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PurgeServiceInstance", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
minAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = commandregistry.Dependency{
UI: ui,
示例6:
"github.com/cloudfoundry/cli/cf/commandregistry"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("create-service command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
requirementsFactory *requirementsfakes.FakeFactory
serviceRepo *apifakes.FakeServiceRepository
serviceBuilder *servicebuilderfakes.FakeServiceBuilder
offering1 models.ServiceOffering
offering2 models.ServiceOffering
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = config
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.ServiceBuilder = serviceBuilder
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("create-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
示例7:
testconfig "github.com/cloudfoundry/cli/testhelpers/configuration"
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("PurgeServiceOffering", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
loginRequirement requirements.Requirement
maxAPIVersionRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
repoLocator := deps.RepoLocator.SetServiceRepository(serviceRepo)
deps = commandregistry.Dependency{
UI: ui,
示例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/cloudfoundry/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("rename-service command", func() {
var (
ui *testterm.FakeUI
config coreconfig.Repository
serviceRepo *apifakes.FakeServiceRepository
requirementsFactory *testreq.FakeReqFactory
deps commandregistry.Dependency
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.RepoLocator = deps.RepoLocator.SetServiceRepository(serviceRepo)
deps.Config = config
commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("rename-service").SetDependency(deps, pluginCall))
}
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
serviceRepo = new(apifakes.FakeServiceRepository)
示例9:
"github.com/cloudfoundry/cli/cf/actors/servicebuilder"
"github.com/cloudfoundry/cli/cf/api/apifakes"
"github.com/cloudfoundry/cli/cf/models"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Service Builder", func() {
var (
planBuilder *planbuilderfakes.FakePlanBuilder
serviceBuilder servicebuilder.ServiceBuilder
serviceRepo *apifakes.FakeServiceRepository
service1 models.ServiceOffering
service2 models.ServiceOffering
v1Service models.ServiceOffering
planWithoutOrgs models.ServicePlanFields
plan1 models.ServicePlanFields
plan2 models.ServicePlanFields
plan3 models.ServicePlanFields
)
BeforeEach(func() {
serviceRepo = new(apifakes.FakeServiceRepository)
planBuilder = new(planbuilderfakes.FakePlanBuilder)
serviceBuilder = servicebuilder.NewBuilder(serviceRepo, planBuilder)
service1 = models.ServiceOffering{
ServiceOfferingFields: models.ServiceOfferingFields{
Label: "my-service1",
GUID: "service-guid1",