示例#1
0
			Context("when the ActualLrpNetInfo is invalid", func() {
				BeforeEach(func() {
					request.ActualLrpNetInfo.Address = ""
				})

				It("returns a validation error", func() {
					Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"address"}))
				})
			})
		})
	})

	Describe("FailActualLRPRequest", func() {
		Describe("Validate", func() {
			var request models.FailActualLRPRequest

			BeforeEach(func() {
				request = models.FailActualLRPRequest{
					ActualLrpKey: &models.ActualLRPKey{ProcessGuid: "p-guid", Index: 2, Domain: "domain"},
					ErrorMessage: "string",
				}
			})

			Context("when valid", func() {
				It("returns nil", func() {
					Expect(request.Validate()).To(BeNil())
				})
			})

			Context("when the ActualLrpKey is blank", func() {
示例#2
0
					It("does not stop the instances", func() {
						Expect(cellClient.StopLRPInstanceCallCount()).To(Equal(0))
					})
				})
			})
		})
	})

	Describe("FailActualLRP", func() {
		var (
			request   models.FailActualLRPRequest
			failErr   *models.Error
			actualLRP *models.ActualLRP

			lrpKey       models.ActualLRPKey
			instanceKey  models.ActualLRPInstanceKey
			errorMessage string

			processGuid string
			index       int32
			domain      string
		)

		JustBeforeEach(func() {
			request.ActualLrpKey = &lrpKey
			request.ErrorMessage = errorMessage
			failErr = etcdDB.FailActualLRP(logger, &request)
		})

		Context("when the actual LRP exists", func() {
			BeforeEach(func() {