Exemplo n.º 1
0
					})
				})

				Context("when fetching the desired lrp fails", func() {
					BeforeEach(func() {
						fakeDesiredLRPDB.DesiredLRPByProcessGuidReturns(nil, errors.New("you lose."))
					})

					It("does not update the actual lrps", func() {
						Expect(responseRecorder.Code).To(Equal(http.StatusOK))
						response := models.DesiredLRPLifecycleResponse{}
						err := response.Unmarshal(responseRecorder.Body.Bytes())
						Expect(err).NotTo(HaveOccurred())
						Expect(response.Error).To(BeNil())

						Expect(fakeActualLRPDB.UnclaimActualLRPCallCount()).To(Equal(0))
						Expect(fakeAuctioneerClient.RequestLRPAuctionsCallCount()).To(Equal(0))
					})
				})

				Context("when fetching the actual lrps groups fails", func() {
					BeforeEach(func() {
						fakeActualLRPDB.ActualLRPGroupsByProcessGuidReturns(nil, errors.New("you lose."))
					})

					It("does not update the actual lrps", func() {
						Expect(responseRecorder.Code).To(Equal(http.StatusOK))
						response := models.DesiredLRPLifecycleResponse{}
						err := response.Unmarshal(responseRecorder.Body.Bytes())
						Expect(err).NotTo(HaveOccurred())
						Expect(response.Error).To(BeNil())