)

var _ = Describe("Evacuation Handlers", func() {
	var (
		logger           lager.Logger
		fakeEvacuationDB *fakes.FakeEvacuationDB
		responseRecorder *httptest.ResponseRecorder
		handler          *handlers.EvacuationHandler
	)

	BeforeEach(func() {
		fakeEvacuationDB = new(fakes.FakeEvacuationDB)
		logger = lager.NewLogger("test")
		logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
		responseRecorder = httptest.NewRecorder()
		handler = handlers.NewEvacuationHandler(logger, fakeEvacuationDB)
	})

	Describe("RemoveEvacuatingActualLRP", func() {
		var (
			processGuid = "process-guid"
			index       = int32(1)

			key         models.ActualLRPKey
			instanceKey models.ActualLRPInstanceKey

			requestBody interface{}
		)

		BeforeEach(func() {
			key = models.NewActualLRPKey(
Esempio n. 2
0
		responseRecorder     *httptest.ResponseRecorder
		handler              *handlers.EvacuationHandler
		exitCh               chan struct{}
	)

	BeforeEach(func() {
		fakeEvacuationDB = new(dbfakes.FakeEvacuationDB)
		fakeActualLRPDB = new(dbfakes.FakeActualLRPDB)
		fakeDesiredLRPDB = new(dbfakes.FakeDesiredLRPDB)
		actualHub = new(eventfakes.FakeHub)
		fakeAuctioneerClient = new(auctioneerfakes.FakeClient)
		logger = lagertest.NewTestLogger("test")
		logger.RegisterSink(lager.NewWriterSink(GinkgoWriter, lager.DEBUG))
		responseRecorder = httptest.NewRecorder()
		exitCh = make(chan struct{}, 1)
		handler = handlers.NewEvacuationHandler(logger, fakeEvacuationDB, fakeActualLRPDB, fakeDesiredLRPDB, actualHub, fakeAuctioneerClient, exitCh)
	})

	Describe("RemoveEvacuatingActualLRP", func() {
		var (
			processGuid = "process-guid"
			index       = int32(1)

			key         models.ActualLRPKey
			instanceKey models.ActualLRPInstanceKey
			actual      *models.ActualLRP

			requestBody interface{}
		)

		BeforeEach(func() {