예제 #1
0
		})

		Context("when has DelaySeconds", func() {
			BeforeEach(func() {
				sqsProperties1.DelaySeconds = "test-delay-seconds"
			})

			It("makes the proper calls", func() {
				_, _, err := sqsBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)
				Expect(queue.CreateQueueDetails.DelaySeconds).To(Equal("test-delay-seconds"))
				Expect(err).ToNot(HaveOccurred())
			})

			Context("and has DelaySeconds Parameter", func() {
				BeforeEach(func() {
					provisionDetails.Parameters = map[string]interface{}{"delay_seconds": "test-delay-seconds-parameter"}
				})

				It("makes the proper calls", func() {
					_, _, err := sqsBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)
					Expect(queue.CreateQueueDetails.DelaySeconds).To(Equal("test-delay-seconds-parameter"))
					Expect(err).ToNot(HaveOccurred())
				})

				Context("but user provision parameters are not allowed", func() {
					BeforeEach(func() {
						allowUserProvisionParameters = false
					})

					It("makes the proper calls", func() {
						_, _, err := sqsBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)
		Context("when has TimeoutInMinutes", func() {
			BeforeEach(func() {
				cfProperties1.TimeoutInMinutes = int64(1)
			})

			It("makes the proper calls", func() {
				_, _, err := cfBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)
				Expect(stack.CreateStackDetails.TimeoutInMinutes).To(Equal(int64(1)))
				Expect(err).ToNot(HaveOccurred())
			})
		})

		Context("when has user provision parameters", func() {
			BeforeEach(func() {
				provisionDetails.Parameters = map[string]interface{}{"test-key-1": "test-value-1", "test-key-2": "test-value-2"}
			})

			It("makes the proper calls", func() {
				_, _, err := cfBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)
				Expect(stack.CreateStackDetails.Parameters).To(Equal(map[string]string{"test-key-1": "test-value-1", "test-key-2": "test-value-2"}))
				Expect(err).ToNot(HaveOccurred())
			})

			Context("but are not allowed", func() {
				BeforeEach(func() {
					allowUserProvisionParameters = false
				})

				It("makes the proper calls", func() {
					_, _, err := cfBroker.Provision(instanceID, provisionDetails, acceptsIncomplete)