testserver

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RecordedResponse

type RecordedResponse struct {
	Body       []byte
	StatusCode int
	Fixture    string
}

type TestServer

type TestServer struct {
	EnqueuedResponses map[string][]RecordedResponse
	ObservedRequests  []*http.Request
	Server            *httptest.Server
}

func NewTestServer

func NewTestServer(l logging.SimpleLogger) (*TestServer, func())

func (*TestServer) EnqueueResponse

func (ts *TestServer) EnqueueResponse(t *testing.T, path string, statusCode int, fixture string)

func (*TestServer) LastRequest

func (ts *TestServer) LastRequest() (*http.Request, error)

func (*TestServer) Reset

func (ts *TestServer) Reset()

Jump to

Keyboard shortcuts

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