Back to godoc.org

Package test

v1.1.0
Latest Go to latest

The latest major version is .

Published: Dec 12, 2019 | License: GPL3 | Module: github.com/paysuper/paysuper-management-api

Index

func BuildDispatcher

func BuildDispatcher(ctx context.Context, settings config.Settings, srv common.Services, handlers common.Handlers, observer invoker.Observer) (*dispatcher.Dispatcher, func(), error)

func DefaultSettings

func DefaultSettings() map[string]interface{}

DefaultSettings

func PreAuthUserMiddleware

func PreAuthUserMiddleware(user *common.AuthUser) echo.MiddlewareFunc

PreAuthUserMiddleware

func ProviderTestInitial

func ProviderTestInitial() config.Initial

ProviderTestInitial

func ReqInitApplicationForm

func ReqInitApplicationForm() func(request *http.Request, middleware Middleware)

ReqInitApplicationForm

func ReqInitJSON

func ReqInitJSON() func(request *http.Request, middleware Middleware)

ReqInitJSON

func ReqInitMultipartForm

func ReqInitMultipartForm() func(request *http.Request, middleware Middleware)

ReqInitMultipartForm

func ReqInitXML

func ReqInitXML() func(request *http.Request, middleware Middleware)

ReqInitXML

type EchoReqResCaller

type EchoReqResCaller struct {
	// contains filtered or unexported fields
}

EchoReqResCaller

func NewTestRequest

func NewTestRequest(dispatcher httpEcho.Dispatcher, mw *MiddlewareTestUp) *EchoReqResCaller

NewTestRequest

func SetUp

func SetUp(settings map[string]interface{}, services common.Services, setUp func(*TestSet, Middleware) common.Handlers) (*EchoReqResCaller, error)

SetUp

func (*EchoReqResCaller) Builder

func (c *EchoReqResCaller) Builder() *QueryBuilder

Send

func (*EchoReqResCaller) Request

func (c *EchoReqResCaller) Request(method, target string, body io.Reader, init func(*http.Request, Middleware)) (resRec *httptest.ResponseRecorder, err error)

Request

type Middleware

type Middleware interface {
	Post(middleware ...echo.MiddlewareFunc)
	Pre(middleware ...echo.MiddlewareFunc)
}

type MiddlewareHandlerFunc

type MiddlewareHandlerFunc func(echo.Context) (echo.Context, error)

type MiddlewareTestUp

type MiddlewareTestUp struct {
	// contains filtered or unexported fields
}

func (*MiddlewareTestUp) ListPre

func (m *MiddlewareTestUp) ListPre() []echo.MiddlewareFunc

ListPre

func (*MiddlewareTestUp) ListUse

func (m *MiddlewareTestUp) ListUse() []echo.MiddlewareFunc

ListUse

func (*MiddlewareTestUp) Post

func (m *MiddlewareTestUp) Post(middleware ...echo.MiddlewareFunc)

Post

func (*MiddlewareTestUp) Pre

func (m *MiddlewareTestUp) Pre(middleware ...echo.MiddlewareFunc)

Pre

type QueryBuilder

type QueryBuilder struct {
	// contains filtered or unexported fields
}

func NewQueryBuilder

func NewQueryBuilder(c *EchoReqResCaller) *QueryBuilder

NewQueryBuilder

func (*QueryBuilder) AddCookie

func (s *QueryBuilder) AddCookie(cookie *http.Cookie) *QueryBuilder

SetCookie

func (*QueryBuilder) Body

func (s *QueryBuilder) Body(body io.Reader) *QueryBuilder

Body

func (*QueryBuilder) BodyBytes

func (s *QueryBuilder) BodyBytes(body []byte) *QueryBuilder

BodyBytes

func (*QueryBuilder) BodyString

func (s *QueryBuilder) BodyString(body string) *QueryBuilder

BodyString

func (*QueryBuilder) Exec

func (s *QueryBuilder) Exec(t *testing.T) (*httptest.ResponseRecorder, error)

Exec

func (*QueryBuilder) ExecFileUpload

func (s *QueryBuilder) ExecFileUpload(t *testing.T, params map[string]string, paramName, path string) (*httptest.ResponseRecorder, error)

ExecFileUpload

func (*QueryBuilder) Init

func (s *QueryBuilder) Init(init func(*http.Request, Middleware)) *QueryBuilder

Init

func (*QueryBuilder) Method

func (s *QueryBuilder) Method(method string) *QueryBuilder

Method

func (*QueryBuilder) Params

func (s *QueryBuilder) Params(params ...string) *QueryBuilder

Params

func (*QueryBuilder) Path

func (s *QueryBuilder) Path(path string) *QueryBuilder

Path

func (*QueryBuilder) SetQueryParam

func (s *QueryBuilder) SetQueryParam(key, value string) *QueryBuilder

SetQueryParam

func (*QueryBuilder) SetQueryParams

func (s *QueryBuilder) SetQueryParams(values url.Values) *QueryBuilder

SetQueryParams

type TestSet

type TestSet struct {
	AwareSet     provider.AwareSet
	Configurator config.Configurator
	GlobalConfig *common.Config
	HandlerSet   common.HandlerSet
	Initial      config.Initial
}

func BuildTestSet

func BuildTestSet(ctx context.Context, settings config.Settings, srv common.Services, observer invoker.Observer) (*TestSet, func(), error)

func ProviderTestSet

func ProviderTestSet(initial config.Initial, awareSet provider.AwareSet, srv common.Services, configurator config.Configurator, globalConfig *common.Config, validate *validator.Validate) (*TestSet, func(), error)

ProviderTestSet

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier