コード例 #1
0
			routeGuid           string
		)

		BeforeEach(func() {
			serviceInstanceGuid = "service-instance-guid"
			routeGuid = "route-guid"
		})

		It("creates the service binding when the service instance is managed", func() {
			ccServer.AppendHandlers(
				ghttp.CombineHandlers(
					ghttp.VerifyRequest("PUT", fmt.Sprintf("/v2/service_instances/%s/routes/%s", serviceInstanceGuid, routeGuid)),
					ghttp.RespondWith(http.StatusNoContent, nil),
				),
			)
			err := routeServiceBindingRepo.Bind(serviceInstanceGuid, routeGuid, false, "")
			Expect(err).NotTo(HaveOccurred())
			Expect(ccServer.ReceivedRequests()).To(HaveLen(1))
		})

		It("creates the service binding when the service instance is user-provided", func() {
			ccServer.AppendHandlers(
				ghttp.CombineHandlers(
					ghttp.VerifyRequest("PUT", fmt.Sprintf("/v2/user_provided_service_instances/%s/routes/%s", serviceInstanceGuid, routeGuid)),
					ghttp.RespondWith(http.StatusCreated, nil),
				),
			)
			err := routeServiceBindingRepo.Bind(serviceInstanceGuid, routeGuid, true, "")
			Expect(err).NotTo(HaveOccurred())
			Expect(ccServer.ReceivedRequests()).To(HaveLen(1))
		})
コード例 #2
0
			routeGuid           string
		)

		BeforeEach(func() {
			serviceInstanceGuid = "service-instance-guid"
			routeGuid = "route-guid"
		})

		It("creates the service binding when the service instance is managed", func() {
			ccServer.AppendHandlers(
				ghttp.CombineHandlers(
					ghttp.VerifyRequest("PUT", fmt.Sprintf("/v2/service_instances/%s/routes/%s", serviceInstanceGuid, routeGuid)),
					ghttp.RespondWith(http.StatusNoContent, nil),
				),
			)
			err := routeServiceBindingRepo.Bind(serviceInstanceGuid, routeGuid, false)
			Expect(err).NotTo(HaveOccurred())
			Expect(ccServer.ReceivedRequests()).To(HaveLen(1))
		})

		It("creates the service binding when the service instance is user-provided", func() {
			ccServer.AppendHandlers(
				ghttp.CombineHandlers(
					ghttp.VerifyRequest("PUT", fmt.Sprintf("/v2/user_provided_service_instances/%s/routes/%s", serviceInstanceGuid, routeGuid)),
					ghttp.RespondWith(http.StatusCreated, nil),
				),
			)
			err := routeServiceBindingRepo.Bind(serviceInstanceGuid, routeGuid, true)
			Expect(err).NotTo(HaveOccurred())
			Expect(ccServer.ReceivedRequests()).To(HaveLen(1))
		})