示例#1
0
func getPushDependencies() (deps pushDependencies) {
	deps.manifestRepo = &testmanifest.FakeManifestRepository{}
	deps.starter = &testcmd.FakeAppStarter{}
	deps.stopper = &testcmd.FakeAppStopper{}
	deps.binder = &testcmd.FakeAppBinder{}
	deps.appRepo = &testapi.FakeApplicationRepository{}

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

	deps.routeRepo = &testapi.FakeRouteRepository{}
	deps.stackRepo = &testapi.FakeStackRepository{}
	deps.appBitsRepo = &testapi.FakeApplicationBitsRepository{}
	deps.serviceRepo = &testapi.FakeServiceRepo{}

	return
}
示例#2
0
		routeRepo     *testapi.FakeRouteRepository
		stackRepo     *testapi.FakeStackRepository
		appBitsRepo   *testapi.FakeApplicationBitsRepository
		serviceRepo   *testapi.FakeServiceRepo
		wordGenerator words.WordGenerator
	)

	BeforeEach(func() {
		manifestRepo = &testmanifest.FakeManifestRepository{}
		starter = &testcmd.FakeAppStarter{}
		stopper = &testcmd.FakeAppStopper{}
		binder = &testcmd.FakeAppBinder{}
		appRepo = &testapi.FakeApplicationRepository{}

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

		routeRepo = &testapi.FakeRouteRepository{}
		stackRepo = &testapi.FakeStackRepository{}
		appBitsRepo = &testapi.FakeApplicationBitsRepository{}
		serviceRepo = &testapi.FakeServiceRepo{}
		wordGenerator = testwords.NewFakeWordGenerator("laughing-cow")

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

		cmd = NewPush(ui, configRepo, manifestRepo, starter, stopper, binder, appRepo, domainRepo, routeRepo, stackRepo, serviceRepo, appBitsRepo, wordGenerator)
	})

	callPush := func(args ...string) {