Context("when the cell", func() { Context("is present", func() { BeforeEach(func() { cellPresence = models.NewCellPresence( cellID, "cell1.addr", "", "the-zone", models.NewCellCapacity(128, 1024, 6), []string{}, []string{}, []string{}, []string{}, ) fakeServiceClient.CellByIdReturns(&cellPresence, nil) }) It("stops the LRPs", func() { Expect(fakeRepClientFactory.CreateClientCallCount()).To(Equal(1)) Expect(fakeRepClientFactory.CreateClientArgsForCall(0)).To(Equal(cellPresence.RepAddress)) Expect(fakeServiceClient.CellByIdCallCount()).To(Equal(1)) _, fetchedCellID := fakeServiceClient.CellByIdArgsForCall(0) Expect(fetchedCellID).To(Equal(cellID)) Expect(fakeRepClient.StopLRPInstanceCallCount()).Should(Equal(1)) stoppedKey, stoppedInstanceKey := fakeRepClient.StopLRPInstanceArgsForCall(0) Expect(stoppedKey).To(Equal(key)) Expect(stoppedInstanceKey).To(Equal(instanceKey)) })