Documentation
¶
Index ¶
- func Contains(expression string, expected interface{}) func(*http.Response, *http.Request) error
- func Equal(expression string, expected interface{}) func(*http.Response, *http.Request) error
- func GreaterThan(expression string, minimumLength int) func(*http.Response, *http.Request) error
- func JWTHeaderEqual(tokenSelector func(*http.Response) (string, error), expression string, ...) func(*http.Response, *http.Request) error
- func JWTPayloadEqual(tokenSelector func(*http.Response) (string, error), expression string, ...) func(*http.Response, *http.Request) error
- func Len(expression string, expectedLength int) func(*http.Response, *http.Request) error
- func LessThan(expression string, maximumLength int) func(*http.Response, *http.Request) error
- func Matches(expression string, regexp string) func(*http.Response, *http.Request) error
- func NotEqual(expression string, expected interface{}) func(*http.Response, *http.Request) error
- func NotPresent(expression string) func(*http.Response, *http.Request) error
- func Present(expression string) func(*http.Response, *http.Request) error
- type AssertionChain
- func (r *AssertionChain) Contains(expression string, expected interface{}) *AssertionChain
- func (r *AssertionChain) End() func(*http.Response, *http.Request) error
- func (r *AssertionChain) Equal(expression string, expected interface{}) *AssertionChain
- func (r *AssertionChain) Matches(expression, regexp string) *AssertionChain
- func (r *AssertionChain) NotEqual(expression string, expected interface{}) *AssertionChain
- func (r *AssertionChain) NotPresent(expression string) *AssertionChain
- func (r *AssertionChain) Present(expression string) *AssertionChain
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains is a convenience function to assert that a jsonpath expression extracts a value in an array
func GreaterThan ¶
GreaterThan asserts that value is greater than the given length, determined by reflect.Len
func JWTHeaderEqual ¶
func JWTPayloadEqual ¶
func LessThan ¶
LessThan asserts that value is less than the given length, determined by reflect.Len
func NotEqual ¶
NotEqual is a function to check json path expression value is not equal to given value
func NotPresent ¶
NotPresent asserts that value returned by the expression is not present
Types ¶
type AssertionChain ¶
type AssertionChain struct {
// contains filtered or unexported fields
}
AssertionChain supports chaining assertions and root expressions
func Root ¶
func Root(expression string) *AssertionChain
Root creates a new assertion chain prefixed with the given expression
func (*AssertionChain) Contains ¶
func (r *AssertionChain) Contains(expression string, expected interface{}) *AssertionChain
Contains adds an Contains assertion to the chain
func (*AssertionChain) End ¶
End returns an func(*http.Response, *http.Request) error which is a combination of the registered assertions
func (*AssertionChain) Equal ¶
func (r *AssertionChain) Equal(expression string, expected interface{}) *AssertionChain
Equal adds an Equal assertion to the chain
func (*AssertionChain) Matches ¶
func (r *AssertionChain) Matches(expression, regexp string) *AssertionChain
Matches adds an Matches assertion to the chain
func (*AssertionChain) NotEqual ¶
func (r *AssertionChain) NotEqual(expression string, expected interface{}) *AssertionChain
NotEqual adds an NotEqual assertion to the chain
func (*AssertionChain) NotPresent ¶
func (r *AssertionChain) NotPresent(expression string) *AssertionChain
NotPresent adds an NotPresent assertion to the chain
func (*AssertionChain) Present ¶
func (r *AssertionChain) Present(expression string) *AssertionChain
Present adds an Present assertion to the chain