Documentation ¶
Index ¶
- func NewTestKernelFactory[T salusaconfig.Config](k *kernel.Kernel, cfg T) func(t *testing.T) *TestKernel[T]
- type HttpResult
- func (r *HttpResult) AssertJSON(body any) *HttpResult
- func (r *HttpResult) AssertJSONString(jsonBody string) *HttpResult
- func (r *HttpResult) AssertStatus(status int) *HttpResult
- func (r *HttpResult) AssertStatus2XX() *HttpResult
- func (r *HttpResult) AssertStatus3XX() *HttpResult
- func (r *HttpResult) AssertStatus4XX() *HttpResult
- func (r *HttpResult) AssertStatus5XX() *HttpResult
- func (r *HttpResult) AssertStatusOK() *HttpResult
- func (r *HttpResult) AssertStatusRange(min, max int) *HttpResult
- func (r *HttpResult) Body() []byte
- type RequestBuilder
- func (rb *RequestBuilder) Delete(target string, body io.Reader) *HttpResult
- func (rb *RequestBuilder) DeleteJSON(target string, body any) *HttpResult
- func (rb *RequestBuilder) Get(target string) *HttpResult
- func (rb *RequestBuilder) GetJSON(target string) *HttpResult
- func (rb *RequestBuilder) NewRequest(method, target string, body io.Reader) *http.Request
- func (rb *RequestBuilder) Patch(target string, body io.Reader) *HttpResult
- func (rb *RequestBuilder) PatchJSON(target string, body any) *HttpResult
- func (rb *RequestBuilder) Post(target string, body io.Reader) *HttpResult
- func (rb *RequestBuilder) PostJSON(target string, body any) *HttpResult
- func (rb *RequestBuilder) Put(target string, body io.Reader) *HttpResult
- func (rb *RequestBuilder) PutJSON(target string, body any) *HttpResult
- func (rb *RequestBuilder) WithHeader(key, value string) *RequestBuilder
- func (rb *RequestBuilder) WithJSONHeaders() *RequestBuilder
- type TestKernel
- func (k *TestKernel[T]) Delete(target string, body io.Reader) *HttpResult
- func (k *TestKernel[T]) DeleteJSON(target string, body any) *HttpResult
- func (k *TestKernel[T]) Get(target string) *HttpResult
- func (k *TestKernel[T]) GetJSON(target string) *HttpResult
- func (k *TestKernel[T]) HandleRequest(r *http.Request) *HttpResult
- func (k *TestKernel[T]) Patch(target string, body io.Reader) *HttpResult
- func (k *TestKernel[T]) PatchJSON(target string, body any) *HttpResult
- func (k *TestKernel[T]) Post(target string, body io.Reader) *HttpResult
- func (k *TestKernel[T]) PostJSON(target string, body any) *HttpResult
- func (k *TestKernel[T]) Put(target string, body io.Reader) *HttpResult
- func (k *TestKernel[T]) PutJSON(target string, body any) *HttpResult
- func (k *TestKernel[T]) WithHeader(key, value string) *RequestBuilder
- func (k *TestKernel[T]) WithJSONHeaders() *RequestBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestKernelFactory ¶
func NewTestKernelFactory[T salusaconfig.Config](k *kernel.Kernel, cfg T) func(t *testing.T) *TestKernel[T]
Types ¶
type HttpResult ¶
type HttpResult struct {
// contains filtered or unexported fields
}
func (*HttpResult) AssertJSON ¶
func (r *HttpResult) AssertJSON(body any) *HttpResult
func (*HttpResult) AssertJSONString ¶ added in v0.11.2
func (r *HttpResult) AssertJSONString(jsonBody string) *HttpResult
func (*HttpResult) AssertStatus ¶
func (r *HttpResult) AssertStatus(status int) *HttpResult
func (*HttpResult) AssertStatus2XX ¶ added in v0.11.2
func (r *HttpResult) AssertStatus2XX() *HttpResult
func (*HttpResult) AssertStatus3XX ¶ added in v0.11.2
func (r *HttpResult) AssertStatus3XX() *HttpResult
func (*HttpResult) AssertStatus4XX ¶ added in v0.11.2
func (r *HttpResult) AssertStatus4XX() *HttpResult
func (*HttpResult) AssertStatus5XX ¶ added in v0.11.2
func (r *HttpResult) AssertStatus5XX() *HttpResult
func (*HttpResult) AssertStatusOK ¶ added in v0.11.2
func (r *HttpResult) AssertStatusOK() *HttpResult
func (*HttpResult) AssertStatusRange ¶ added in v0.11.2
func (r *HttpResult) AssertStatusRange(min, max int) *HttpResult
func (*HttpResult) Body ¶
func (r *HttpResult) Body() []byte
type RequestBuilder ¶ added in v0.11.2
type RequestBuilder struct {
// contains filtered or unexported fields
}
func NewRequestBuilder ¶ added in v0.11.2
func NewRequestBuilder[T salusaconfig.Config](k *TestKernel[T]) *RequestBuilder
func (*RequestBuilder) Delete ¶ added in v0.11.2
func (rb *RequestBuilder) Delete(target string, body io.Reader) *HttpResult
func (*RequestBuilder) DeleteJSON ¶ added in v0.11.2
func (rb *RequestBuilder) DeleteJSON(target string, body any) *HttpResult
func (*RequestBuilder) Get ¶ added in v0.11.2
func (rb *RequestBuilder) Get(target string) *HttpResult
func (*RequestBuilder) GetJSON ¶ added in v0.11.2
func (rb *RequestBuilder) GetJSON(target string) *HttpResult
func (*RequestBuilder) NewRequest ¶ added in v0.11.2
func (*RequestBuilder) Patch ¶ added in v0.11.2
func (rb *RequestBuilder) Patch(target string, body io.Reader) *HttpResult
func (*RequestBuilder) PatchJSON ¶ added in v0.11.2
func (rb *RequestBuilder) PatchJSON(target string, body any) *HttpResult
func (*RequestBuilder) Post ¶ added in v0.11.2
func (rb *RequestBuilder) Post(target string, body io.Reader) *HttpResult
func (*RequestBuilder) PostJSON ¶ added in v0.11.2
func (rb *RequestBuilder) PostJSON(target string, body any) *HttpResult
func (*RequestBuilder) Put ¶ added in v0.11.2
func (rb *RequestBuilder) Put(target string, body io.Reader) *HttpResult
func (*RequestBuilder) PutJSON ¶ added in v0.11.2
func (rb *RequestBuilder) PutJSON(target string, body any) *HttpResult
func (*RequestBuilder) WithHeader ¶ added in v0.11.2
func (rb *RequestBuilder) WithHeader(key, value string) *RequestBuilder
func (*RequestBuilder) WithJSONHeaders ¶ added in v0.11.2
func (rb *RequestBuilder) WithJSONHeaders() *RequestBuilder
type TestKernel ¶
type TestKernel[T salusaconfig.Config] struct { // contains filtered or unexported fields }
func (*TestKernel[T]) Delete ¶ added in v0.11.2
func (k *TestKernel[T]) Delete(target string, body io.Reader) *HttpResult
func (*TestKernel[T]) DeleteJSON ¶ added in v0.11.2
func (k *TestKernel[T]) DeleteJSON(target string, body any) *HttpResult
func (*TestKernel[T]) Get ¶
func (k *TestKernel[T]) Get(target string) *HttpResult
func (*TestKernel[T]) GetJSON ¶
func (k *TestKernel[T]) GetJSON(target string) *HttpResult
func (*TestKernel[T]) HandleRequest ¶
func (k *TestKernel[T]) HandleRequest(r *http.Request) *HttpResult
func (*TestKernel[T]) Patch ¶ added in v0.11.2
func (k *TestKernel[T]) Patch(target string, body io.Reader) *HttpResult
func (*TestKernel[T]) PatchJSON ¶ added in v0.11.2
func (k *TestKernel[T]) PatchJSON(target string, body any) *HttpResult
func (*TestKernel[T]) Post ¶
func (k *TestKernel[T]) Post(target string, body io.Reader) *HttpResult
func (*TestKernel[T]) PostJSON ¶
func (k *TestKernel[T]) PostJSON(target string, body any) *HttpResult
func (*TestKernel[T]) Put ¶ added in v0.11.2
func (k *TestKernel[T]) Put(target string, body io.Reader) *HttpResult
func (*TestKernel[T]) PutJSON ¶ added in v0.11.2
func (k *TestKernel[T]) PutJSON(target string, body any) *HttpResult
func (*TestKernel[T]) WithHeader ¶ added in v0.11.2
func (k *TestKernel[T]) WithHeader(key, value string) *RequestBuilder
func (*TestKernel[T]) WithJSONHeaders ¶ added in v0.11.2
func (k *TestKernel[T]) WithJSONHeaders() *RequestBuilder
Click to show internal directories.
Click to hide internal directories.