github.com/wanddynosios/cli/v8@v8.7.9-0.20240221182337-1a92e3a7017f/api/uaa/resources_test.go (about) 1 package uaa_test 2 3 import ( 4 . "code.cloudfoundry.org/cli/api/uaa" 5 "code.cloudfoundry.org/cli/api/uaa/uaafakes" 6 . "github.com/onsi/ginkgo" 7 . "github.com/onsi/gomega" 8 ) 9 10 var _ = Describe("SetupResources", func() { 11 var ( 12 client *Client 13 fakeConfig *uaafakes.FakeConfig 14 15 setupResourcesErr error 16 ) 17 18 BeforeEach(func() { 19 fakeConfig = NewTestConfig() 20 client = NewClient(fakeConfig) 21 }) 22 23 JustBeforeEach(func() { 24 setupResourcesErr = client.SetupResources(uaaServer.URL(), server.URL()) 25 }) 26 27 It("populates client.info", func() { 28 Expect(setupResourcesErr).ToNot(HaveOccurred()) 29 Expect(client.Info.Links.UAA).To(Equal(uaaServer.URL())) 30 Expect(client.Info.Links.Login).To(Equal(server.URL())) 31 32 Expect(fakeConfig.SetUAAEndpointCallCount()).To(Equal(1)) 33 Expect(fakeConfig.SetUAAEndpointArgsForCall(0)).To(Equal(uaaServer.URL())) 34 }) 35 })