当前位置: 首页>>代码示例>>Golang>>正文


Golang ReadWriter.SetUaaEndpoint方法代码示例

本文整理汇总了Golang中github.com/cloudfoundry/cli/cf/configuration/core_config.ReadWriter.SetUaaEndpoint方法的典型用法代码示例。如果您正苦于以下问题:Golang ReadWriter.SetUaaEndpoint方法的具体用法?Golang ReadWriter.SetUaaEndpoint怎么用?Golang ReadWriter.SetUaaEndpoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/cloudfoundry/cli/cf/configuration/core_config.ReadWriter的用法示例。


在下文中一共展示了ReadWriter.SetUaaEndpoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1:

		client api.UserRepository

		config     core_config.ReadWriter
		ccServer   *ghttp.Server
		uaaServer  *ghttp.Server
		ccGateway  net.Gateway
		uaaGateway net.Gateway
	)

	BeforeEach(func() {
		ccServer = ghttp.NewServer()
		uaaServer = ghttp.NewServer()

		config = testconfig.NewRepositoryWithDefaults()
		config.SetApiEndpoint(ccServer.URL())
		config.SetUaaEndpoint(uaaServer.URL())
		ccGateway = net.NewCloudControllerGateway(config, time.Now, &testterm.FakeUI{})
		uaaGateway = net.NewUAAGateway(config, &testterm.FakeUI{})
		client = api.NewCloudControllerUserRepository(config, uaaGateway, ccGateway)
	})

	AfterEach(func() {
		if ccServer != nil {
			ccServer.Close()
		}
		if uaaServer != nil {
			uaaServer.Close()
		}
	})

	Describe("ListUsersInOrgForRole", func() {
开发者ID:brandontheis,项目名称:cli,代码行数:31,代码来源:users_test.go

示例2:

		if uaaServer != nil {
			uaaServer.Close()
		}
		if ccServer != nil {
			ccServer.Close()
		}
	})

	setupCCServer := func(requests ...testnet.TestRequest) {
		ccServer, ccHandler = testnet.NewServer(requests)
		config.SetApiEndpoint(ccServer.URL)
	}

	setupUAAServer := func(requests ...testnet.TestRequest) {
		uaaServer, uaaHandler = testnet.NewServer(requests)
		config.SetUaaEndpoint(uaaServer.URL)
	}

	Describe("listing the users with a given role using ListUsersInOrgForRole()", func() {
		Context("when there are no users in the given org", func() {
			It("lists the users in a org with a given role", func() {
				ccReqs := []testnet.TestRequest{
					testapi.NewCloudControllerTestRequest(testnet.TestRequest{
						Method: "GET",
						Path:   "/v2/organizations/my-org-guid/managers",
						Response: testnet.TestResponse{
							Status: http.StatusOK,
							Body:   `{"resources": []}`,
						}}),
				}
开发者ID:tools-alexuser01,项目名称:cli,代码行数:30,代码来源:users_test.go


注:本文中的github.com/cloudfoundry/cli/cf/configuration/core_config.ReadWriter.SetUaaEndpoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。