mockserver

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

CI

mockserver-client-go

A go client for integrating with mockserver: http://www.mock-server.com.

Documentation

Overview

Package mockserver ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a mockserver for mockserver.

func NewClient

func NewClient(address string) *Client

NewClient creates a new mockserver.

func (*Client) CreateExpectation

func (c *Client) CreateExpectation(expectation create.Expectation) error

CreateExpectation creates a new expectation (request/response) in the mockserver. If the expectation is received successfully, the response will be a 201 HTTP status code.

func (*Client) Reset

func (c *Client) Reset() error

Reset to reset all request expectations and logs from the mockserver.

func (*Client) VerifyRequest

func (c *Client) VerifyRequest(expectation verify.Expectation) error

VerifyRequest to verify a specific request was made to the mockserver. If the matching request was received the specified number of times, the response will be a 202 HTTP status code. If the request was not received the designated times, a 406 HTTP status code is issued.

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is an HTTP client interface.

Directories

Path Synopsis
Package create ...
Package create ...
test
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
Package verify ...
Package verify ...

Jump to

Keyboard shortcuts

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