handler.RemoveActualLRP(responseRecorder, request) }) Context("when removing the actual lrp in the DB succeeds", func() { var removedActualLRP models.ActualLRP BeforeEach(func() { removedActualLRP = actualLRP removedActualLRP.ActualLRPInstanceKey = instanceKey fakeActualLRPDB.RemoveActualLRPReturns(nil) }) It("removes the actual lrp by process guid and index", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) Expect(fakeActualLRPDB.RemoveActualLRPCallCount()).To(Equal(1)) _, actualProcessGuid, idx := fakeActualLRPDB.RemoveActualLRPArgsForCall(0) Expect(actualProcessGuid).To(Equal(processGuid)) Expect(idx).To(BeEquivalentTo(index)) }) It("response with no error", func() { Expect(responseRecorder.Code).To(Equal(http.StatusOK)) response := &models.ActualLRPLifecycleResponse{} err := response.Unmarshal(responseRecorder.Body.Bytes()) Expect(err).NotTo(HaveOccurred()) Expect(response.Error).To(BeNil()) }) }) Context("when removing the actual lrp fails", func() {