本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes.FakeEndpointRepository类的典型用法代码示例。如果您正苦于以下问题:Golang FakeEndpointRepository类的具体用法?Golang FakeEndpointRepository怎么用?Golang FakeEndpointRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FakeEndpointRepository类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1:
testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Login Command", func() {
var (
Flags []string
Config coreconfig.Repository
ui *testterm.FakeUI
authRepo *authenticationfakes.FakeAuthenticationRepository
endpointRepo *coreconfigfakes.FakeEndpointRepository
orgRepo *organizationsfakes.FakeOrganizationRepository
spaceRepo *apifakes.FakeSpaceRepository
org models.Organization
deps commandregistry.Dependency
minCLIVersion string
minRecommendedCLIVersion string
)
updateCommandDependency := func(pluginCall bool) {
deps.UI = ui
deps.Config = Config
deps.RepoLocator = deps.RepoLocator.SetEndpointRepository(endpointRepo)
deps.RepoLocator = deps.RepoLocator.SetAuthenticationRepository(authRepo)
deps.RepoLocator = deps.RepoLocator.SetOrganizationRepository(orgRepo)
deps.RepoLocator = deps.RepoLocator.SetSpaceRepository(spaceRepo)
示例2:
. "github.com/onsi/gomega"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/commands"
"github.com/cloudfoundry/cli/cf/configuration/coreconfig/coreconfigfakes"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/testhelpers/matchers"
)
var _ = Describe("Api", func() {
var (
config coreconfig.Repository
endpointRepo *coreconfigfakes.FakeEndpointRepository
deps commandregistry.Dependency
requirementsFactory *requirementsfakes.FakeFactory
ui *testterm.FakeUI
cmd commands.API
flagContext flags.FlagContext
repoLocator api.RepositoryLocator
runCLIErr error
)
callApi := func(args []string) {
err := flagContext.Parse(args...)
Expect(err).NotTo(HaveOccurred())
runCLIErr = cmd.Execute(flagContext)
}
BeforeEach(func() {
ui = new(testterm.FakeUI)
示例3:
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("OneTimeSSHCode", func() {
var (
ui *testterm.FakeUI
configRepo coreconfig.Repository
authRepo *authenticationfakes.FakeRepository
endpointRepo *coreconfigfakes.FakeEndpointRepository
cmd commandregistry.Command
deps commandregistry.Dependency
factory *requirementsfakes.FakeFactory
flagContext flags.FlagContext
endpointRequirement requirements.Requirement
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
configRepo = testconfig.NewRepositoryWithDefaults()
configRepo.SetAPIEndpoint("fake-api-endpoint")
endpointRepo = new(coreconfigfakes.FakeEndpointRepository)
repoLocator := deps.RepoLocator.SetEndpointRepository(endpointRepo)
authRepo = new(authenticationfakes.FakeRepository)
示例4:
It("extrapolates the loggregator URL based on the API URL (non-SSL API)", func() {
endpoint := r.LoggregatorEndpoint(ccInfo, "http://127.0.0.1:80")
Expect(endpoint).To(Equal("ws://loggregator.0.0.1:80"))
})
})
})
Describe("Refresh", func() {
BeforeEach(func() {
config := configuration.NewRepositoryWithDefaults()
i18n.T = i18n.Init(config)
})
Context("when the cloud controller returns an insecure api endpoint", func() {
var (
r APIConfigRefresher
ccInfo *CCInfo
endpointRepo *coreconfigfakes.FakeEndpointRepository
)
BeforeEach(func() {
ccInfo = &CCInfo{
LoggregatorEndpoint: "some-endpoint",
}
endpointRepo = new(coreconfigfakes.FakeEndpointRepository)
r = APIConfigRefresher{
EndpointRepo: endpointRepo,
Config: new(coreconfigfakes.FakeReadWriter),
Endpoint: "api.some.endpoint.com",
}
})