JustBeforeEach(func() { handler.EvacuateStoppedActualLRP(responseRecorder, request) }) It("does not error and does not keep the container", func() { response := models.EvacuationResponse{} err := response.Unmarshal(responseRecorder.Body.Bytes()) Expect(err).NotTo(HaveOccurred()) Expect(response.KeepContainer).To(BeFalse()) Expect(response.Error).To(BeNil()) }) It("removes the actual lrp", func() { Expect(fakeActualLRPDB.RemoveActualLRPCallCount()).To(Equal(1)) _, guid, index, actualLRPInstanceKey := fakeActualLRPDB.RemoveActualLRPArgsForCall(0) Expect(guid).To(Equal("process-guid")) Expect(index).To(BeEquivalentTo(1)) Expect(actualLRPInstanceKey).To(Equal(&actual.ActualLRPInstanceKey)) }) It("removes the evacuating actual lrp", func() { Expect(fakeEvacuationDB.RemoveEvacuatingActualLRPCallCount()).To(Equal(1)) _, lrpKey, lrpInstanceKey := fakeEvacuationDB.RemoveEvacuatingActualLRPArgsForCall(0) Expect(*lrpKey).To(Equal(actual.ActualLRPKey)) Expect(*lrpInstanceKey).To(Equal(actual.ActualLRPInstanceKey)) }) It("emits events to the hub", func() { Eventually(actualHub.EmitCallCount).Should(Equal(2))