本文整理匯總了Golang中github.com/nttlabs/cli/cf/api/fakes.FakeAuthenticationRepository類的典型用法代碼示例。如果您正苦於以下問題:Golang FakeAuthenticationRepository類的具體用法?Golang FakeAuthenticationRepository怎麽用?Golang FakeAuthenticationRepository使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了FakeAuthenticationRepository類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
testcmd "github.com/nttlabs/cli/testhelpers/commands"
testconfig "github.com/nttlabs/cli/testhelpers/configuration"
testterm "github.com/nttlabs/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/nttlabs/cli/testhelpers/matchers"
)
var _ = Describe("Login Command", func() {
var (
Flags []string
Config core_config.ReadWriter
ui *testterm.FakeUI
authRepo *testapi.FakeAuthenticationRepository
endpointRepo *testapi.FakeEndpointRepo
orgRepo *fake_organizations.FakeOrganizationRepository
spaceRepo *testapi.FakeSpaceRepository
org models.Organization
)
BeforeEach(func() {
Flags = []string{}
Config = testconfig.NewRepository()
ui = &testterm.FakeUI{}
authRepo = &testapi.FakeAuthenticationRepository{
AccessToken: "my_access_token",
RefreshToken: "my_refresh_token",
Config: Config,
}
示例2:
testcmd "github.com/nttlabs/cli/testhelpers/commands"
testconfig "github.com/nttlabs/cli/testhelpers/configuration"
testreq "github.com/nttlabs/cli/testhelpers/requirements"
testterm "github.com/nttlabs/cli/testhelpers/terminal"
. "github.com/nttlabs/cli/cf/commands/serviceaccess"
. "github.com/nttlabs/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("service-access command", func() {
var (
ui *testterm.FakeUI
actor *testactor.FakeServiceActor
requirementsFactory *testreq.FakeReqFactory
serviceBroker1 models.ServiceBroker
serviceBroker2 models.ServiceBroker
tokenRefresher *testapi.FakeAuthenticationRepository
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
actor = &testactor.FakeServiceActor{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true}
tokenRefresher = &testapi.FakeAuthenticationRepository{}
})
runCommand := func(args ...string) bool {
cmd := NewServiceAccess(ui, testconfig.NewRepositoryWithDefaults(), actor, tokenRefresher)
return testcmd.RunCommand(cmd, args, requirementsFactory)
}
示例3:
"github.com/nttlabs/cli/cf/models"
testcmd "github.com/nttlabs/cli/testhelpers/commands"
testconfig "github.com/nttlabs/cli/testhelpers/configuration"
testreq "github.com/nttlabs/cli/testhelpers/requirements"
testterm "github.com/nttlabs/cli/testhelpers/terminal"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/nttlabs/cli/testhelpers/matchers"
)
var _ = Describe("auth command", func() {
var (
ui *testterm.FakeUI
cmd Authenticate
config core_config.ReadWriter
repo *testapi.FakeAuthenticationRepository
requirementsFactory *testreq.FakeReqFactory
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
config = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
repo = &testapi.FakeAuthenticationRepository{
Config: config,
AccessToken: "my-access-token",
RefreshToken: "my-refresh-token",
}
cmd = NewAuthenticate(ui, config, repo)
})
示例4:
"github.com/nttlabs/cli/cf/configuration/core_config"
"github.com/nttlabs/cli/cf/errors"
. "github.com/nttlabs/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CopySource", func() {
var (
ui *testterm.FakeUI
config core_config.ReadWriter
requirementsFactory *testreq.FakeReqFactory
authRepo *testapi.FakeAuthenticationRepository
appRepo *testApplication.FakeApplicationRepository
copyAppSourceRepo *testCopyApplication.FakeCopyApplicationSourceRepository
spaceRepo *testapi.FakeSpaceRepository
orgRepo *testorg.FakeOrganizationRepository
appRestarter *testcmd.FakeApplicationRestarter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}
authRepo = &testapi.FakeAuthenticationRepository{}
appRepo = &testApplication.FakeApplicationRepository{}
copyAppSourceRepo = &testCopyApplication.FakeCopyApplicationSourceRepository{}
spaceRepo = &testapi.FakeSpaceRepository{}
orgRepo = &testorg.FakeOrganizationRepository{}
appRestarter = &testcmd.FakeApplicationRestarter{}
示例5:
"github.com/nttlabs/cli/cf/configuration/core_config"
testcmd "github.com/nttlabs/cli/testhelpers/commands"
testconfig "github.com/nttlabs/cli/testhelpers/configuration"
testreq "github.com/nttlabs/cli/testhelpers/requirements"
testterm "github.com/nttlabs/cli/testhelpers/terminal"
. "github.com/nttlabs/cli/cf/commands"
. "github.com/nttlabs/cli/testhelpers/matchers"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("OauthToken", func() {
var (
ui *testterm.FakeUI
authRepo *testapi.FakeAuthenticationRepository
requirementsFactory *testreq.FakeReqFactory
configRepo core_config.ReadWriter
)
BeforeEach(func() {
ui = &testterm.FakeUI{}
authRepo = &testapi.FakeAuthenticationRepository{}
configRepo = testconfig.NewRepositoryWithDefaults()
requirementsFactory = &testreq.FakeReqFactory{}
})
runCommand := func() bool {
cmd := NewOAuthToken(ui, configRepo, authRepo)
return testcmd.RunCommand(cmd, []string{}, requirementsFactory)
}