當前位置: 首頁>>代碼示例>>Golang>>正文


Golang Domain.OwningOrganizationGuid方法代碼示例

本文整理匯總了Golang中cf.Domain.OwningOrganizationGuid方法的典型用法代碼示例。如果您正苦於以下問題:Golang Domain.OwningOrganizationGuid方法的具體用法?Golang Domain.OwningOrganizationGuid怎麽用?Golang Domain.OwningOrganizationGuid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cf.Domain的用法示例。


在下文中一共展示了Domain.OwningOrganizationGuid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: TestPushingAppWhenItDoesNotExist

func TestPushingAppWhenItDoesNotExist(t *testing.T) {
	deps := getPushDependencies()

	domain := cf.Domain{}
	domain.Guid = "not-the-right-guid"
	domain.Name = "not shared domain"
	domain.OwningOrganizationGuid = "my-org-guid"

	sharedDomain := cf.Domain{}
	sharedDomain.Name = "foo.cf-app.com"
	sharedDomain.Shared = true
	sharedDomain.Guid = "foo-domain-guid"
	appRepo := deps.appRepo
	domainRepo := deps.domainRepo
	routeRepo := deps.routeRepo
	appBitsRepo := deps.appBitsRepo
	stopper := deps.stopper
	starter := deps.starter

	domainRepo.ListDomainsForOrgDomains = []cf.Domain{domain, sharedDomain}
	routeRepo.FindByHostAndDomainErr = true

	appRepo.ReadNotFound = true

	ui := callPush(t, []string{"-t", "111", "my-new-app"}, deps)
	assert.Equal(t, appRepo.CreatedAppParams().Get("name").(string), "my-new-app")
	assert.Equal(t, appRepo.CreatedAppParams().Get("space_guid").(string), "my-space-guid")

	assert.Equal(t, routeRepo.FindByHostAndDomainHost, "my-new-app")
	assert.Equal(t, routeRepo.CreatedHost, "my-new-app")
	assert.Equal(t, routeRepo.CreatedDomainGuid, "foo-domain-guid")
	assert.Equal(t, routeRepo.BoundAppGuid, "my-new-app-guid")
	assert.Equal(t, routeRepo.BoundRouteGuid, "my-new-app-route-guid")

	assert.Equal(t, appBitsRepo.UploadedAppGuid, "my-new-app-guid")

	testassert.SliceContains(t, ui.Outputs, testassert.Lines{
		{"Creating app", "my-new-app", "my-org", "my-space"},
		{"OK"},
		{"Creating", "my-new-app.foo.cf-app.com"},
		{"OK"},
		{"Binding", "my-new-app.foo.cf-app.com"},
		{"OK"},
		{"Uploading my-new-app"},
		{"OK"},
	})

	assert.Equal(t, stopper.AppToStop.Guid, "")
	assert.Equal(t, starter.AppToStart.Guid, "my-new-app-guid")
	assert.Equal(t, starter.AppToStart.Name, "my-new-app")
	assert.Equal(t, starter.Timeout, 111)
}
開發者ID:pmuellr,項目名稱:cli,代碼行數:52,代碼來源:push_test.go


注:本文中的cf.Domain.OwningOrganizationGuid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。