Example #1
0
		command_registry.Register(stopper)
		command_registry.Register(serviceBinder)

		command_registry.Commands.SetCommand(command_registry.Commands.FindCommand("push").SetDependency(deps, false))
	}

	BeforeEach(func() {
		manifestRepo = &testmanifest.FakeManifestRepository{}

		starter = &appCmdFakes.FakeApplicationStarter{}
		stopper = &appCmdFakes.FakeApplicationStopper{}
		serviceBinder = &serviceCmdFakes.FakeAppBinder{}

		//setup fake commands (counterfeiter) to correctly interact with command_registry
		starter.SetDependencyStub = func(_ command_registry.Dependency, _ bool) command_registry.Command {
			return starter
		}
		starter.MetaDataReturns(command_registry.CommandMetadata{Name: "start"})

		stopper.SetDependencyStub = func(_ command_registry.Dependency, _ bool) command_registry.Command {
			return stopper
		}
		stopper.MetaDataReturns(command_registry.CommandMetadata{Name: "stop"})

		appRepo = &testApplication.FakeApplicationRepository{}

		domainRepo = &testapi.FakeDomainRepository{}
		sharedDomain := maker.NewSharedDomainFields(maker.Overrides{"name": "foo.cf-app.com", "guid": "foo-domain-guid"})
		domainRepo.ListDomainsForOrgDomains = []models.DomainFields{sharedDomain}

		//save original command dependences and restore later