Пример #1
0
)

var _ = Describe("StopLRPInstanceHandler", func() {
	var stopInstanceHandler *handlers.StopLRPInstanceHandler
	var fakeClient *executorfakes.FakeClient
	var resp *httptest.ResponseRecorder
	var req *http.Request

	BeforeEach(func() {
		var err error
		fakeClient = &executorfakes.FakeClient{}

		logger := lagertest.NewTestLogger("test")
		logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))

		stopInstanceHandler = handlers.NewStopLRPInstanceHandler(logger, fakeClient)

		resp = httptest.NewRecorder()

		req, err = http.NewRequest("POST", "", nil)
		Expect(err).NotTo(HaveOccurred())
	})

	JustBeforeEach(func() {
		stopInstanceHandler.ServeHTTP(resp, req)
	})

	Context("when the request is valid", func() {
		var processGuid string
		var instanceGuid string
Пример #2
0
)

var _ = Describe("StopLRPInstanceHandler", func() {
	var stopInstanceHandler *handlers.StopLRPInstanceHandler
	var fakeStopper *fake_lrp_stopper.FakeLRPStopper
	var resp *httptest.ResponseRecorder
	var req *http.Request

	BeforeEach(func() {
		var err error
		fakeStopper = &fake_lrp_stopper.FakeLRPStopper{}

		logger := lagertest.NewTestLogger("test")
		logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))

		stopInstanceHandler = handlers.NewStopLRPInstanceHandler(logger, fakeStopper)

		resp = httptest.NewRecorder()

		req, err = http.NewRequest("POST", "", nil)
		Expect(err).NotTo(HaveOccurred())
	})

	JustBeforeEach(func() {
		stopInstanceHandler.ServeHTTP(resp, req)
	})

	Context("when the request is valid", func() {
		var processGuid string
		var instanceGuid string