Ejemplo n.º 1
0
			})

			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())