resttest

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package resttest provides helper methods for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpectMessage

func ExpectMessage(t *testing.T, wrap wrapped.Response, msg string)

ExpectMessage expects message in wrapped.Response.

func ExpectStatusAndMessage

func ExpectStatusAndMessage(t *testing.T, resp *http.Response, wrap wrapped.Response, code int, msg string)

ExpectStatusAndMessage expects statusCode statusCode in http.Response and in wrapped.Response and message in wrapped.Response.

func ExpectStatusCode

func ExpectStatusCode(t *testing.T, resp *http.Response, wrap wrapped.Response, code int)

ExpectStatusCode expects statusCode in http.Response and in wrapped.Response.

func ParseToWrapped

func ParseToWrapped(t *testing.T, r io.Reader) wrapped.Response

ParseToWrapped will parse r into wrapped.Response.

func Request

func Request(t *testing.T, method, url string, body interface{}) *http.Request

Request will build a REST http request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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