}) }) Context("when the ActualLrpInstanceKey is invalid", func() { BeforeEach(func() { request.ActualLrpInstanceKey.InstanceGuid = "" }) It("returns a validation error", func() { Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"instance_guid"})) }) }) Context("when the ActualLrpNetInfo is blank", func() { BeforeEach(func() { request.ActualLrpNetInfo = nil }) It("returns a validation error", func() { Expect(request.Validate()).To(ConsistOf(models.ErrInvalidField{"actual_lrp_net_info"})) }) }) 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("StartActualLRP", func() { var ( startErr *models.Error request models.StartActualLRPRequest startedActualLRP *models.ActualLRP lrpKey models.ActualLRPKey instanceKey models.ActualLRPInstanceKey netInfo models.ActualLRPNetInfo ) JustBeforeEach(func() { request.ActualLrpKey = &lrpKey request.ActualLrpInstanceKey = &instanceKey request.ActualLrpNetInfo = &netInfo startedActualLRP, startErr = etcdDB.StartActualLRP(logger, &request) }) Context("when the actual LRP exists", func() { var ( processGuid string index int32 actualLRP *models.ActualLRP ) BeforeEach(func() { index = 1 processGuid = "some-process-guid" key := models.NewActualLRPKey(processGuid, index, "domain") actualLRP = &models.ActualLRP{