client

package
v0.0.0-...-1a88b7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandlerTester

func NewHandlerTester(t *testing.T,
	method string,
	path string,
	routerPath string,
	requestParams map[string]string,
	requestPayload string,
	requestHeaders map[string]string,
	responseStatus int,
	responseBody string,
	responseHeaders map[string]string,
	middleware ...echo.MiddlewareFunc,
) (*echo.Echo, echo.Context, *httptest.ResponseRecorder)

NewHandlerTester will help to build a temporary echo service which will mock the response we want to test the inventory client component. method indicate the http method to mock, such as "GET", "PUT", "DELETE" path the url path we need to mock. requestParams hashmap for the parameters value. body the payload string that we want to receive for the above request. Return an echo framework initialized and ready to start.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL