本文整理匯總了Golang中cf/configuration.ReadWriter.SetAuthorizationEndpoint方法的典型用法代碼示例。如果您正苦於以下問題:Golang ReadWriter.SetAuthorizationEndpoint方法的具體用法?Golang ReadWriter.SetAuthorizationEndpoint怎麽用?Golang ReadWriter.SetAuthorizationEndpoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cf/configuration.ReadWriter
的用法示例。
在下文中一共展示了ReadWriter.SetAuthorizationEndpoint方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1:
})
It("extrapolates the loggregator URL based on the API URL (non-SSL API)", func() {
config.SetApiEndpoint("http://api.run.pivotal.io")
repo := NewEndpointRepository(config, net.NewCloudControllerGateway())
endpoint, apiResponse := repo.GetLoggregatorEndpoint()
Expect(apiResponse.IsSuccessful()).To(BeTrue())
Expect(endpoint).To(Equal("ws://loggregator.run.pivotal.io:80"))
})
})
It("TestGetUAAEndpoint", func() {
config := testconfig.NewRepository()
config.SetAuthorizationEndpoint("https://login.example.com")
repo := NewEndpointRepository(config, net.NewCloudControllerGateway())
endpoint, apiResponse := repo.GetUAAEndpoint()
Expect(apiResponse.IsSuccessful()).To(BeTrue())
Expect(endpoint).To(Equal("https://uaa.example.com"))
})
It("TestEndpointsReturnAnErrorWhenMissing", func() {
config := testconfig.NewRepository()
repo := NewEndpointRepository(config, net.NewCloudControllerGateway())
_, response := repo.GetLoggregatorEndpoint()
Expect(response.IsNotSuccessful()).To(BeTrue())