func init() { commandregistry.Register(&CreateSpaceQuota{}) }
func init() { commandregistry.Register(&SetEnv{}) }
func init() { commandregistry.Register(&RunningEnvironmentVariableGroup{}) }
//save original command and restore later originalSSHCodeGetter = commandregistry.Commands.FindCommand("ssh-code") sshCodeGetter = new(commandsfakes.FakeSSHCodeGetter) //setup fakes to correctly interact with commandregistry sshCodeGetter.SetDependencyStub = func(_ commandregistry.Dependency, _ bool) commandregistry.Command { return sshCodeGetter } sshCodeGetter.MetaDataReturns(commandregistry.CommandMetadata{Name: "ssh-code"}) }) AfterEach(func() { //restore original command commandregistry.Register(originalSSHCodeGetter) }) updateCommandDependency := func(pluginCall bool) { deps.UI = ui deps.Config = configRepo //inject fake 'sshCodeGetter' into registry commandregistry.Register(sshCodeGetter) commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("ssh").SetDependency(deps, pluginCall)) } runCommand := func(args ...string) bool { return testcmd.RunCLICommand("ssh", args, requirementsFactory, updateCommandDependency, false, ui) }
func init() { commandregistry.Register(&ListSpaces{}) }
func init() { commandregistry.Register(&ShowSpace{}) }
func init() { commandregistry.Register(&DeleteServiceBroker{}) }
func init() { commandregistry.Register(&DeleteServiceKey{}) }
func init() { commandregistry.Register(&CreateSecurityGroup{}) }
func init() { commandregistry.Register(&ListPluginRepos{}) }
func init() { commandregistry.Register(&unbindFromStagingGroup{}) }
func init() { commandregistry.Register(&UpdateBuildpack{}) }
starter *applicationfakes.FakeStarter stopper *applicationfakes.FakeStopper config coreconfig.Repository app models.Application originalStop commandregistry.Command originalStart commandregistry.Command deps commandregistry.Dependency applicationReq *requirementsfakes.FakeApplicationRequirement ) updateCommandDependency := func(pluginCall bool) { deps.UI = ui deps.Config = config //inject fake 'stopper and starter' into registry commandregistry.Register(starter) commandregistry.Register(stopper) commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("restart").SetDependency(deps, pluginCall)) } runCommand := func(args ...string) bool { return testcmd.RunCLICommand("restart", args, requirementsFactory, updateCommandDependency, false, ui) } BeforeEach(func() { ui = &testterm.FakeUI{} deps = commandregistry.NewDependency(os.Stdout, new(tracefakes.FakePrinter)) requirementsFactory = new(requirementsfakes.FakeFactory) starter = new(applicationfakes.FakeStarter) stopper = new(applicationfakes.FakeStopper)
func init() { commandregistry.Register(&DeleteServiceAuthTokenFields{}) }
func init() { commandregistry.Register(&BindService{}) }
func init() { commandregistry.Register(&ListOrgs{}) }
func init() { commandregistry.Register(&UnsetSpaceRole{}) }
func init() { commandregistry.Register(&SetHealthCheck{}) }
func init() { commandregistry.Register(&DeleteRoute{}) }
func init() { commandregistry.Register(&RenameServiceBroker{}) }
func init() { commandregistry.Register(&PluginUninstall{}) }
func init() { commandregistry.Register(&SSHEnabled{}) }
func init() { commandregistry.Register(&CreateOrg{}) }
func init() { commandregistry.Register(&CreateDomain{}) }
func init() { commandregistry.Register(&OAuthToken{}) }
BeforeEach(func() { ui = &testterm.FakeUI{} configRepo = testconfig.NewRepositoryWithDefaults() routeRepo = new(apifakes.FakeRouteRepository) repoLocator := deps.RepoLocator.SetRouteRepository(routeRepo) deps = commandregistry.Dependency{ UI: ui, Config: configRepo, RepoLocator: repoLocator, } originalCreateRouteCmd = commandregistry.Commands.FindCommand("create-route") fakeCreateRouteCmd = new(routefakes.OldFakeRouteCreator) commandregistry.Register(fakeCreateRouteCmd) cmd = &route.MapRoute{} cmd.SetDependency(deps, false) flagContext = flags.NewFlagContext(cmd.MetaData().Flags) factory = new(requirementsfakes.FakeFactory) loginRequirement = &passingRequirement{Name: "login-requirement"} factory.NewLoginRequirementReturns(loginRequirement) applicationRequirement = new(requirementsfakes.FakeApplicationRequirement) factory.NewApplicationRequirementReturns(applicationRequirement) fakeApplication := models.Application{}
func init() { commandregistry.Register(&DisableServiceAccess{}) }
func init() { commandregistry.Register(Api{}) }
func init() { commandregistry.Register(&AllowSpaceSSH{}) }
func init() { commandregistry.Register(&DeleteUser{}) }