wiremock

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const Name = "http/server"

Name sets the reference to be used in the tomato.yml file

Variables

This section is empty.

Functions

This section is empty.

Types

type Wiremock

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

Wiremock contains the configuration for the wiremock stubbing resource

func New

func New(cfg *config.Resource) (*Wiremock, error)

New connects and creates the wiremock resource create the stub via the API you can post the request/response JSON to http://<host>:<port>/__admin/mappings

func (*Wiremock) Close added in v1.4.1

func (w *Wiremock) Close() error

Close satisfies the resource interface

func (*Wiremock) GetRequestsCount

func (w *Wiremock) GetRequestsCount(method, path string) (int, error)

GetRequestsCount get requests count on the mock endpoint

func (*Wiremock) Open added in v1.4.1

func (w *Wiremock) Open() error

Open satisfies the resource interface

func (*Wiremock) Ready

func (w *Wiremock) Ready() error

Ready informs tomato of when wiremock is ready to handle connections

func (*Wiremock) Reset

func (w *Wiremock) Reset() error

Reset removes all mappings and responses to put wiremock back into its base state

func (*Wiremock) SetResponse

func (w *Wiremock) SetResponse(method string, requestPath string, responseCode int, responseBody []byte) error

SetResponse satisfies the http/server interface for setting requests and their responses

func (*Wiremock) SetResponseFromFile added in v1.4.1

func (w *Wiremock) SetResponseFromFile(method string, requestPath string, responseCode int, fileName string) error

SetResponseFromFile satisfies the http/server interface for setting requests and their responses while reading stubs from a file

Jump to

Keyboard shortcuts

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