Example #1
0
		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
		OriginalCommandStart = command_registry.Commands.FindCommand("start")
		OriginalCommandStop = command_registry.Commands.FindCommand("stop")
		OriginalCommandServiceBind = command_registry.Commands.FindCommand("bind-service")

		routeRepo = &testapi.FakeRouteRepository{}
		routeRepo.CreateStub = func(host string, domain models.DomainFields, path string) (models.Route, error) {
			// This never returns an error, which means it isn't tested.
			// This is copied from the old route repo fake.
			route := models.Route{}
			route.Guid = host + "-route-guid"
			route.Domain = domain
			route.Host = host
			route.Path = path

			return route, nil
		}
		stackRepo = &testStacks.FakeStackRepository{}
		serviceRepo = &testapi.FakeServiceRepository{}
		authRepo = &testapi.FakeAuthenticationRepository{}
		wordGenerator = new(testwords.FakeWordGenerator)
		wordGenerator.BabbleReturns("random-host")

		ui = new(testterm.FakeUI)
		configRepo = testconfig.NewRepositoryWithDefaults()

		requirementsFactory = &testreq.FakeReqFactory{LoginSuccess: true, TargetedSpaceSuccess: true}