Expect(err).NotTo(HaveOccurred()) desiredLRP, err = etcdDB.DesiredLRPByProcessGuid(logger, lrp.ProcessGuid) Expect(err).NotTo(HaveOccurred()) update = &models.DesiredLRPUpdate{} }) Context("When the updates are valid", func() { BeforeEach(func() { annotation := "new-annotation" instances := int32(16) rawMessage := json.RawMessage([]byte(`{"port":8080,"hosts":["new-route-1","new-route-2"]}`)) update.Routes = &models.Routes{ "router": &rawMessage, } update.Annotation = &annotation update.Instances = &instances }) It("updates an existing DesireLRP", func() { _, modelErr := etcdDB.UpdateDesiredLRP(logger, lrp.ProcessGuid, update) Expect(modelErr).NotTo(HaveOccurred()) updated, modelErr := etcdDB.DesiredLRPByProcessGuid(logger, lrp.ProcessGuid) Expect(modelErr).NotTo(HaveOccurred()) Expect(*updated.Routes).To(HaveKey("router")) json, err := (*update.Routes)["router"].MarshalJSON() Expect(err).NotTo(HaveOccurred())