func callListServiceAuthTokens(requirementsFactory *testreq.FakeReqFactory, authTokenRepo *testapi.FakeAuthTokenRepo) (ui *testterm.FakeUI) { ui = &testterm.FakeUI{} config := testconfig.NewRepositoryWithDefaults() cmd := NewListServiceAuthTokens(ui, config, authTokenRepo) testcmd.RunCommand(cmd, []string{}, requirementsFactory) return } var _ = Describe("service-auth-tokens command", func() { var ( ui *testterm.FakeUI configRepo core_config.ReadWriter authTokenRepo *testapi.FakeAuthTokenRepo requirementsFactory *testreq.FakeReqFactory ) BeforeEach(func() { ui = &testterm.FakeUI{Inputs: []string{"y"}} authTokenRepo = &testapi.FakeAuthTokenRepo{} configRepo = testconfig.NewRepositoryWithDefaults() requirementsFactory = &testreq.FakeReqFactory{} }) runCommand := func(args ...string) bool { return testcmd.RunCommand(NewListServiceAuthTokens(ui, configRepo, authTokenRepo), args, requirementsFactory) } Describe("requirements", func() {
"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/cf/commands/serviceauthtoken" . "github.com/cloudfoundry/cli/testhelpers/matchers" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("update-service-auth-token command", func() { var ( ui *testterm.FakeUI configRepo configuration.ReadWriter authTokenRepo *testapi.FakeAuthTokenRepo requirementsFactory *testreq.FakeReqFactory ) BeforeEach(func() { ui = &testterm.FakeUI{Inputs: []string{"y"}} authTokenRepo = &testapi.FakeAuthTokenRepo{} configRepo = testconfig.NewRepositoryWithDefaults() requirementsFactory = &testreq.FakeReqFactory{} }) runCommand := func(args ...string) { testcmd.RunCommand(NewUpdateServiceAuthToken(ui, configRepo, authTokenRepo), args, requirementsFactory) } Describe("requirements", func() {
. "github.com/onsi/ginkgo" . "github.com/onsi/gomega" 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" ) var _ = Describe("delete-service-auth-token command", func() { var ( ui *testterm.FakeUI configRepo core_config.Repository authTokenRepo *testapi.FakeAuthTokenRepo requirementsFactory *testreq.FakeReqFactory deps command_registry.Dependency ) updateCommandDependency := func(pluginCall bool) { deps.Ui = ui deps.RepoLocator = deps.RepoLocator.SetServiceAuthTokenRepository(authTokenRepo) deps.Config = configRepo command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("delete-service-auth-token").SetDependency(deps, pluginCall)) } BeforeEach(func() { ui = &testterm.FakeUI{Inputs: []string{"y"}} authTokenRepo = &testapi.FakeAuthTokenRepo{} configRepo = testconfig.NewRepositoryWithDefaults()