func NewFlowTest() *FlowTest {
	appCtx := appctx.NewApplicationContext()
	initFlow := core.NewInitFlowSynchronization()
	invokeFlow := core.NewInvokeFlowSynchronization()
	registrationService := core.NewRegistrationService(initFlow, invokeFlow)
	renderingService := rendering.NewRenderingService()
	runtime := core.NewRuntime(initFlow, invokeFlow)
	runtime.ManagedThread = &mockthread.MockManagedThread{}
	interopServer := &MockInteropServer{}
	appctx.StoreInteropServer(appCtx, interopServer)
	return &FlowTest{
		AppCtx:              appCtx,
		InitFlow:            initFlow,
		InvokeFlow:          invokeFlow,
		RegistrationService: registrationService,
		RenderingService:    renderingService,
		TelemetryService:    &MockNoOpTelemetryService{},
		Runtime:             runtime,
		InteropServer:       interopServer,
	}
}
NewFlowTest returns new FlowTest configuration.
package testdata
import (
	"context"
	"io"
	"io/ioutil"
	"net/http"
	"go.amzn.com/lambda/appctx"
	"go.amzn.com/lambda/core"
	"go.amzn.com/lambda/core/statejson"
	"go.amzn.com/lambda/interop"
	"go.amzn.com/lambda/rapi/rendering"
	"go.amzn.com/lambda/telemetry"
	"go.amzn.com/lambda/testdata/mockthread"
)
type MockInteropServer struct {
	Response       []byte
	ErrorResponse  *interop.ErrorResponse
	ActiveInvokeID string
}
func (i *MockInteropServer) StartAcceptingDirectInvokes() error { return nil }
func (i *MockInteropServer) SendResponse(invokeID string, reader io.Reader) error {
	bytes, err := ioutil.ReadAll(reader)
	if err != nil {
		return err
	}
	if len(bytes) > interop.MaxPayloadSize {
		return &interop.ErrorResponseTooLarge{
			ResponseSize:    len(bytes),
			MaxResponseSize: interop.MaxPayloadSize,
		}
	}
	i.Response = bytes
	return nil
}
func (i *MockInteropServer) SendErrorResponse(invokeID string, response *interop.ErrorResponse) error {
	i.ErrorResponse = response
	return nil
}
func (i *MockInteropServer) GetCurrentInvokeID() string {
	return i.ActiveInvokeID
}
func (i *MockInteropServer) CommitResponse() error { return nil }
func (i *MockInteropServer) SendRunning(*interop.Running) error { return nil }
func (i *MockInteropServer) SendDone(*interop.Done) error { return nil }
func (i *MockInteropServer) SendDoneFail(*interop.DoneFail) error { return nil }
func (i *MockInteropServer) StartChan() <-chan *interop.Start { return nil }
func (i *MockInteropServer) InvokeChan() <-chan *interop.Invoke { return nil }
func (i *MockInteropServer) ResetChan() <-chan *interop.Reset { return nil }
func (i *MockInteropServer) ShutdownChan() <-chan *interop.Shutdown { return nil }
func (i *MockInteropServer) TransportErrorChan() <-chan error { return nil }
func (i *MockInteropServer) Clear() {}
func (i *MockInteropServer) IsResponseSent() bool {
	return !(i.Response == nil && i.ErrorResponse == nil)
}
func (i *MockInteropServer) SendRuntimeReady() error { return nil }
func (i *MockInteropServer) SetInternalStateGetter(isd interop.InternalStateGetter) {}
func (m *MockInteropServer) Init(i *interop.Start, invokeTimeoutMs int64) {}
func (m *MockInteropServer) Invoke(w http.ResponseWriter, i *interop.Invoke) error { return nil }
func (m *MockInteropServer) Shutdown(shutdown *interop.Shutdown) *statejson.InternalStateDescription { return nil }
type FlowTest struct {
	AppCtx              appctx.ApplicationContext
	InitFlow            core.InitFlowSynchronization
	InvokeFlow          core.InvokeFlowSynchronization
	RegistrationService core.RegistrationService
	RenderingService    *rendering.EventRenderingService
	Runtime             *core.Runtime
	InteropServer       *MockInteropServer
	TelemetryService    *MockNoOpTelemetryService
}
func (s *FlowTest) ConfigureForInit() {
	s.RegistrationService.PreregisterRuntime(s.Runtime)
}
func (s *FlowTest) ConfigureForInvoke(ctx context.Context, invoke *interop.Invoke) {
	s.InteropServer.ActiveInvokeID = invoke.ID
	s.InvokeFlow.InitializeBarriers()
	s.RenderingService.SetRenderer(rendering.NewInvokeRenderer(ctx, invoke, telemetry.GetCustomerTracingHeader))
}
type MockNoOpTelemetryService struct{}
func (m *MockNoOpTelemetryService) Subscribe(agentName string, body io.Reader, headers map[string][]string) ([]byte, int, map[string][]string, error) {
	return []byte(`{}`), http.StatusOK, map[string][]string{}, nil
}
func (s *MockNoOpTelemetryService) RecordCounterMetric(metricName string, count int) {
}
func (s *MockNoOpTelemetryService) FlushMetrics() interop.LogsAPIMetrics {
	return interop.LogsAPIMetrics(map[string]int{})
}
func (m *MockNoOpTelemetryService) Clear() {
}
func (m *MockNoOpTelemetryService) TurnOff() {
}