Documentation
¶
Index ¶
- func Cookie(name, value string) *http.Cookie
- func Cookies(data map[string]string) []*http.Cookie
- func NewAssertableJSON(t *testing.T, json foundation.Json, jsonStr string) (contractshttp.AssertableJSON, error)
- func NewTestRequest(t *testing.T, json foundation.Json, route route.Route, session session.Manager) contractshttp.Request
- func NewTestResponse(t *testing.T, response *http.Response, json foundation.Json, ...) contractshttp.Response
- type AssertableJson
- func (r *AssertableJson) Count(key string, length int) contractshttp.AssertableJSON
- func (r *AssertableJson) Each(key string, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
- func (r *AssertableJson) First(key string, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
- func (r *AssertableJson) Has(key string) contractshttp.AssertableJSON
- func (r *AssertableJson) HasAll(keys []string) contractshttp.AssertableJSON
- func (r *AssertableJson) HasAny(keys []string) contractshttp.AssertableJSON
- func (r *AssertableJson) HasWithScope(key string, length int, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
- func (r *AssertableJson) Json() map[string]any
- func (r *AssertableJson) Missing(key string) contractshttp.AssertableJSON
- func (r *AssertableJson) MissingAll(keys []string) contractshttp.AssertableJSON
- func (r *AssertableJson) Where(key string, value any) contractshttp.AssertableJSON
- func (r *AssertableJson) WhereNot(key string, value any) contractshttp.AssertableJSON
- type TestRequest
- func (r *TestRequest) Bind(value any) contractshttp.Request
- func (r *TestRequest) Delete(uri string, body io.Reader) (contractshttp.Response, error)
- func (r *TestRequest) FlushHeaders() contractshttp.Request
- func (r *TestRequest) Get(uri string) (contractshttp.Response, error)
- func (r *TestRequest) Head(uri string) (contractshttp.Response, error)
- func (r *TestRequest) Options(uri string) (contractshttp.Response, error)
- func (r *TestRequest) Patch(uri string, body io.Reader) (contractshttp.Response, error)
- func (r *TestRequest) Post(uri string, body io.Reader) (contractshttp.Response, error)
- func (r *TestRequest) Put(uri string, body io.Reader) (contractshttp.Response, error)
- func (r *TestRequest) WithBasicAuth(username, password string) contractshttp.Request
- func (r *TestRequest) WithContext(ctx context.Context) contractshttp.Request
- func (r *TestRequest) WithCookie(cookie *http.Cookie) contractshttp.Request
- func (r *TestRequest) WithCookies(cookies []*http.Cookie) contractshttp.Request
- func (r *TestRequest) WithHeader(key, value string) contractshttp.Request
- func (r *TestRequest) WithHeaders(headers map[string]string) contractshttp.Request
- func (r *TestRequest) WithSession(attributes map[string]any) contractshttp.Request
- func (r *TestRequest) WithToken(token string, ttype ...string) contractshttp.Request
- func (r *TestRequest) WithoutHeader(key string) contractshttp.Request
- func (r *TestRequest) WithoutToken() contractshttp.Request
- type TestResponseImpl
- func (r *TestResponseImpl) AssertAccepted() contractshttp.Response
- func (r *TestResponseImpl) AssertBadRequest() contractshttp.Response
- func (r *TestResponseImpl) AssertConflict() contractshttp.Response
- func (r *TestResponseImpl) AssertCookie(name, value string) contractshttp.Response
- func (r *TestResponseImpl) AssertCookieExpired(name string) contractshttp.Response
- func (r *TestResponseImpl) AssertCookieMissing(name string) contractshttp.Response
- func (r *TestResponseImpl) AssertCookieNotExpired(name string) contractshttp.Response
- func (r *TestResponseImpl) AssertCreated() contractshttp.Response
- func (r *TestResponseImpl) AssertDontSee(value []string, escaped ...bool) contractshttp.Response
- func (r *TestResponseImpl) AssertExactJson(data map[string]any) contractshttp.Response
- func (r *TestResponseImpl) AssertFluentJson(callback func(json contractshttp.AssertableJSON)) contractshttp.Response
- func (r *TestResponseImpl) AssertForbidden() contractshttp.Response
- func (r *TestResponseImpl) AssertFound() contractshttp.Response
- func (r *TestResponseImpl) AssertGone() contractshttp.Response
- func (r *TestResponseImpl) AssertHeader(headerName, value string) contractshttp.Response
- func (r *TestResponseImpl) AssertHeaderMissing(headerName string) contractshttp.Response
- func (r *TestResponseImpl) AssertInternalServerError() contractshttp.Response
- func (r *TestResponseImpl) AssertJson(data map[string]any) contractshttp.Response
- func (r *TestResponseImpl) AssertJsonMissing(data map[string]any) contractshttp.Response
- func (r *TestResponseImpl) AssertMethodNotAllowed() contractshttp.Response
- func (r *TestResponseImpl) AssertMovedPermanently() contractshttp.Response
- func (r *TestResponseImpl) AssertNoContent(status ...int) contractshttp.Response
- func (r *TestResponseImpl) AssertNotAcceptable() contractshttp.Response
- func (r *TestResponseImpl) AssertNotFound() contractshttp.Response
- func (r *TestResponseImpl) AssertNotModified() contractshttp.Response
- func (r *TestResponseImpl) AssertOk() contractshttp.Response
- func (r *TestResponseImpl) AssertPartialContent() contractshttp.Response
- func (r *TestResponseImpl) AssertPaymentRequired() contractshttp.Response
- func (r *TestResponseImpl) AssertRequestTimeout() contractshttp.Response
- func (r *TestResponseImpl) AssertSee(value []string, escaped ...bool) contractshttp.Response
- func (r *TestResponseImpl) AssertSeeInOrder(value []string, escaped ...bool) contractshttp.Response
- func (r *TestResponseImpl) AssertServerError() contractshttp.Response
- func (r *TestResponseImpl) AssertServiceUnavailable() contractshttp.Response
- func (r *TestResponseImpl) AssertStatus(status int) contractshttp.Response
- func (r *TestResponseImpl) AssertSuccessful() contractshttp.Response
- func (r *TestResponseImpl) AssertTemporaryRedirect() contractshttp.Response
- func (r *TestResponseImpl) AssertTooManyRequests() contractshttp.Response
- func (r *TestResponseImpl) AssertUnauthorized() contractshttp.Response
- func (r *TestResponseImpl) AssertUnprocessableEntity() contractshttp.Response
- func (r *TestResponseImpl) AssertUnsupportedMediaType() contractshttp.Response
- func (r *TestResponseImpl) Content() (string, error)
- func (r *TestResponseImpl) Cookie(name string) *http.Cookie
- func (r *TestResponseImpl) Cookies() []*http.Cookie
- func (r *TestResponseImpl) Headers() http.Header
- func (r *TestResponseImpl) IsServerError() bool
- func (r *TestResponseImpl) IsSuccessful() bool
- func (r *TestResponseImpl) Json() (map[string]any, error)
- func (r *TestResponseImpl) Session() (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAssertableJSON ¶
func NewAssertableJSON(t *testing.T, json foundation.Json, jsonStr string) (contractshttp.AssertableJSON, error)
func NewTestRequest ¶
func NewTestRequest(t *testing.T, json foundation.Json, route route.Route, session session.Manager) contractshttp.Request
func NewTestResponse ¶
func NewTestResponse(t *testing.T, response *http.Response, json foundation.Json, session contractssession.Manager) contractshttp.Response
Types ¶
type AssertableJson ¶
type AssertableJson struct {
// contains filtered or unexported fields
}
func (*AssertableJson) Count ¶
func (r *AssertableJson) Count(key string, length int) contractshttp.AssertableJSON
func (*AssertableJson) Each ¶
func (r *AssertableJson) Each(key string, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
func (*AssertableJson) First ¶
func (r *AssertableJson) First(key string, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
func (*AssertableJson) Has ¶
func (r *AssertableJson) Has(key string) contractshttp.AssertableJSON
func (*AssertableJson) HasAll ¶
func (r *AssertableJson) HasAll(keys []string) contractshttp.AssertableJSON
func (*AssertableJson) HasAny ¶
func (r *AssertableJson) HasAny(keys []string) contractshttp.AssertableJSON
func (*AssertableJson) HasWithScope ¶
func (r *AssertableJson) HasWithScope(key string, length int, callback func(contractshttp.AssertableJSON)) contractshttp.AssertableJSON
func (*AssertableJson) Json ¶
func (r *AssertableJson) Json() map[string]any
func (*AssertableJson) Missing ¶
func (r *AssertableJson) Missing(key string) contractshttp.AssertableJSON
func (*AssertableJson) MissingAll ¶
func (r *AssertableJson) MissingAll(keys []string) contractshttp.AssertableJSON
func (*AssertableJson) Where ¶
func (r *AssertableJson) Where(key string, value any) contractshttp.AssertableJSON
func (*AssertableJson) WhereNot ¶
func (r *AssertableJson) WhereNot(key string, value any) contractshttp.AssertableJSON
type TestRequest ¶
type TestRequest struct {
// contains filtered or unexported fields
}
func (*TestRequest) Bind ¶
func (r *TestRequest) Bind(value any) contractshttp.Request
func (*TestRequest) Delete ¶
func (r *TestRequest) Delete(uri string, body io.Reader) (contractshttp.Response, error)
func (*TestRequest) FlushHeaders ¶
func (r *TestRequest) FlushHeaders() contractshttp.Request
func (*TestRequest) Get ¶
func (r *TestRequest) Get(uri string) (contractshttp.Response, error)
func (*TestRequest) Head ¶
func (r *TestRequest) Head(uri string) (contractshttp.Response, error)
func (*TestRequest) Options ¶
func (r *TestRequest) Options(uri string) (contractshttp.Response, error)
func (*TestRequest) Patch ¶
func (r *TestRequest) Patch(uri string, body io.Reader) (contractshttp.Response, error)
func (*TestRequest) Post ¶
func (r *TestRequest) Post(uri string, body io.Reader) (contractshttp.Response, error)
func (*TestRequest) Put ¶
func (r *TestRequest) Put(uri string, body io.Reader) (contractshttp.Response, error)
func (*TestRequest) WithBasicAuth ¶
func (r *TestRequest) WithBasicAuth(username, password string) contractshttp.Request
func (*TestRequest) WithContext ¶
func (r *TestRequest) WithContext(ctx context.Context) contractshttp.Request
func (*TestRequest) WithCookie ¶
func (r *TestRequest) WithCookie(cookie *http.Cookie) contractshttp.Request
func (*TestRequest) WithCookies ¶
func (r *TestRequest) WithCookies(cookies []*http.Cookie) contractshttp.Request
func (*TestRequest) WithHeader ¶
func (r *TestRequest) WithHeader(key, value string) contractshttp.Request
func (*TestRequest) WithHeaders ¶
func (r *TestRequest) WithHeaders(headers map[string]string) contractshttp.Request
func (*TestRequest) WithSession ¶
func (r *TestRequest) WithSession(attributes map[string]any) contractshttp.Request
func (*TestRequest) WithToken ¶
func (r *TestRequest) WithToken(token string, ttype ...string) contractshttp.Request
func (*TestRequest) WithoutHeader ¶
func (r *TestRequest) WithoutHeader(key string) contractshttp.Request
func (*TestRequest) WithoutToken ¶
func (r *TestRequest) WithoutToken() contractshttp.Request
type TestResponseImpl ¶
type TestResponseImpl struct {
// contains filtered or unexported fields
}
func (*TestResponseImpl) AssertAccepted ¶
func (r *TestResponseImpl) AssertAccepted() contractshttp.Response
func (*TestResponseImpl) AssertBadRequest ¶
func (r *TestResponseImpl) AssertBadRequest() contractshttp.Response
func (*TestResponseImpl) AssertConflict ¶
func (r *TestResponseImpl) AssertConflict() contractshttp.Response
func (*TestResponseImpl) AssertCookie ¶
func (r *TestResponseImpl) AssertCookie(name, value string) contractshttp.Response
func (*TestResponseImpl) AssertCookieExpired ¶
func (r *TestResponseImpl) AssertCookieExpired(name string) contractshttp.Response
func (*TestResponseImpl) AssertCookieMissing ¶
func (r *TestResponseImpl) AssertCookieMissing(name string) contractshttp.Response
func (*TestResponseImpl) AssertCookieNotExpired ¶
func (r *TestResponseImpl) AssertCookieNotExpired(name string) contractshttp.Response
func (*TestResponseImpl) AssertCreated ¶
func (r *TestResponseImpl) AssertCreated() contractshttp.Response
func (*TestResponseImpl) AssertDontSee ¶
func (r *TestResponseImpl) AssertDontSee(value []string, escaped ...bool) contractshttp.Response
func (*TestResponseImpl) AssertExactJson ¶
func (r *TestResponseImpl) AssertExactJson(data map[string]any) contractshttp.Response
func (*TestResponseImpl) AssertFluentJson ¶
func (r *TestResponseImpl) AssertFluentJson(callback func(json contractshttp.AssertableJSON)) contractshttp.Response
func (*TestResponseImpl) AssertForbidden ¶
func (r *TestResponseImpl) AssertForbidden() contractshttp.Response
func (*TestResponseImpl) AssertFound ¶
func (r *TestResponseImpl) AssertFound() contractshttp.Response
func (*TestResponseImpl) AssertGone ¶
func (r *TestResponseImpl) AssertGone() contractshttp.Response
func (*TestResponseImpl) AssertHeader ¶
func (r *TestResponseImpl) AssertHeader(headerName, value string) contractshttp.Response
func (*TestResponseImpl) AssertHeaderMissing ¶
func (r *TestResponseImpl) AssertHeaderMissing(headerName string) contractshttp.Response
func (*TestResponseImpl) AssertInternalServerError ¶
func (r *TestResponseImpl) AssertInternalServerError() contractshttp.Response
func (*TestResponseImpl) AssertJson ¶
func (r *TestResponseImpl) AssertJson(data map[string]any) contractshttp.Response
func (*TestResponseImpl) AssertJsonMissing ¶
func (r *TestResponseImpl) AssertJsonMissing(data map[string]any) contractshttp.Response
func (*TestResponseImpl) AssertMethodNotAllowed ¶
func (r *TestResponseImpl) AssertMethodNotAllowed() contractshttp.Response
func (*TestResponseImpl) AssertMovedPermanently ¶
func (r *TestResponseImpl) AssertMovedPermanently() contractshttp.Response
func (*TestResponseImpl) AssertNoContent ¶
func (r *TestResponseImpl) AssertNoContent(status ...int) contractshttp.Response
func (*TestResponseImpl) AssertNotAcceptable ¶
func (r *TestResponseImpl) AssertNotAcceptable() contractshttp.Response
func (*TestResponseImpl) AssertNotFound ¶
func (r *TestResponseImpl) AssertNotFound() contractshttp.Response
func (*TestResponseImpl) AssertNotModified ¶
func (r *TestResponseImpl) AssertNotModified() contractshttp.Response
func (*TestResponseImpl) AssertOk ¶
func (r *TestResponseImpl) AssertOk() contractshttp.Response
func (*TestResponseImpl) AssertPartialContent ¶
func (r *TestResponseImpl) AssertPartialContent() contractshttp.Response
func (*TestResponseImpl) AssertPaymentRequired ¶
func (r *TestResponseImpl) AssertPaymentRequired() contractshttp.Response
func (*TestResponseImpl) AssertRequestTimeout ¶
func (r *TestResponseImpl) AssertRequestTimeout() contractshttp.Response
func (*TestResponseImpl) AssertSee ¶
func (r *TestResponseImpl) AssertSee(value []string, escaped ...bool) contractshttp.Response
func (*TestResponseImpl) AssertSeeInOrder ¶
func (r *TestResponseImpl) AssertSeeInOrder(value []string, escaped ...bool) contractshttp.Response
func (*TestResponseImpl) AssertServerError ¶
func (r *TestResponseImpl) AssertServerError() contractshttp.Response
func (*TestResponseImpl) AssertServiceUnavailable ¶
func (r *TestResponseImpl) AssertServiceUnavailable() contractshttp.Response
func (*TestResponseImpl) AssertStatus ¶
func (r *TestResponseImpl) AssertStatus(status int) contractshttp.Response
func (*TestResponseImpl) AssertSuccessful ¶
func (r *TestResponseImpl) AssertSuccessful() contractshttp.Response
func (*TestResponseImpl) AssertTemporaryRedirect ¶
func (r *TestResponseImpl) AssertTemporaryRedirect() contractshttp.Response
func (*TestResponseImpl) AssertTooManyRequests ¶
func (r *TestResponseImpl) AssertTooManyRequests() contractshttp.Response
func (*TestResponseImpl) AssertUnauthorized ¶
func (r *TestResponseImpl) AssertUnauthorized() contractshttp.Response
func (*TestResponseImpl) AssertUnprocessableEntity ¶
func (r *TestResponseImpl) AssertUnprocessableEntity() contractshttp.Response
func (*TestResponseImpl) AssertUnsupportedMediaType ¶
func (r *TestResponseImpl) AssertUnsupportedMediaType() contractshttp.Response
func (*TestResponseImpl) Content ¶
func (r *TestResponseImpl) Content() (string, error)
func (*TestResponseImpl) Cookies ¶
func (r *TestResponseImpl) Cookies() []*http.Cookie
func (*TestResponseImpl) Headers ¶
func (r *TestResponseImpl) Headers() http.Header
func (*TestResponseImpl) IsServerError ¶
func (r *TestResponseImpl) IsServerError() bool
func (*TestResponseImpl) IsSuccessful ¶
func (r *TestResponseImpl) IsSuccessful() bool
Click to show internal directories.
Click to hide internal directories.