Documentation ¶
Index ¶
- type ExpectedAPICall
- func (e *ExpectedAPICall[_, _]) AllCalledExactlyOnce() bool
- func (e *ExpectedAPICall[_, _]) CallCounts() []int
- func (e *ExpectedAPICall[I, _]) HandlerFunction(t *testing.T) func(http.ResponseWriter, *http.Request)
- func (e *ExpectedAPICall[_, _]) PathHandler(t *testing.T) (string, http.HandlerFunc)
- func (e *ExpectedAPICall[_, _]) Signature() string
- type ExpectedAPICallData
- type ExpectedAPICallMulti
- func (e *ExpectedAPICallMulti[_, _]) AllCalledExactlyOnce() bool
- func (e *ExpectedAPICallMulti[_, _]) CallCounts() []int
- func (e *ExpectedAPICallMulti[I, O]) HandlerFunction(t *testing.T) func(http.ResponseWriter, *http.Request)
- func (e *ExpectedAPICallMulti[_, _]) PathHandler(t *testing.T) (string, http.HandlerFunc)
- func (e *ExpectedAPICallMulti[_, _]) Signature() string
- type ExpectedCall
- type ModelService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpectedAPICall ¶
type ExpectedAPICall[IN, OUT any] struct { Method string APIPath string ExpectedRequestBody *IN APIResponse OUT // contains filtered or unexported fields }
func (*ExpectedAPICall[_, _]) AllCalledExactlyOnce ¶
func (e *ExpectedAPICall[_, _]) AllCalledExactlyOnce() bool
func (*ExpectedAPICall[_, _]) CallCounts ¶
func (e *ExpectedAPICall[_, _]) CallCounts() []int
func (*ExpectedAPICall[I, _]) HandlerFunction ¶
func (e *ExpectedAPICall[I, _]) HandlerFunction(t *testing.T) func(http.ResponseWriter, *http.Request)
func (*ExpectedAPICall[_, _]) PathHandler ¶
func (e *ExpectedAPICall[_, _]) PathHandler(t *testing.T) (string, http.HandlerFunc)
func (*ExpectedAPICall[_, _]) Signature ¶
func (e *ExpectedAPICall[_, _]) Signature() string
type ExpectedAPICallData ¶
type ExpectedAPICallMulti ¶
type ExpectedAPICallMulti[IN, OUT any] struct { APIPath string Calls []ExpectedAPICallData[IN, OUT] }
ExpectedAPICallMulti is for cases where you expect multiple calls to the same APIPath with different bodies. Needed because you cannot register two handlers for the same path Bulk Proxy instance delete for example
func (*ExpectedAPICallMulti[_, _]) AllCalledExactlyOnce ¶
func (e *ExpectedAPICallMulti[_, _]) AllCalledExactlyOnce() bool
func (*ExpectedAPICallMulti[_, _]) CallCounts ¶
func (e *ExpectedAPICallMulti[_, _]) CallCounts() []int
func (*ExpectedAPICallMulti[I, O]) HandlerFunction ¶
func (e *ExpectedAPICallMulti[I, O]) HandlerFunction(t *testing.T) func(http.ResponseWriter, *http.Request)
func (*ExpectedAPICallMulti[_, _]) PathHandler ¶
func (e *ExpectedAPICallMulti[_, _]) PathHandler(t *testing.T) (string, http.HandlerFunc)
func (*ExpectedAPICallMulti[_, _]) Signature ¶
func (e *ExpectedAPICallMulti[_, _]) Signature() string
type ExpectedCall ¶
type ModelService ¶
type ModelService struct { Server *httptest.Server ExpectedCalls []ExpectedCall }
func NewModelService ¶
func NewModelService(t *testing.T, expectedCall ...ExpectedCall) *ModelService
func (*ModelService) AssertAllCalledExactlyOnce ¶
func (m *ModelService) AssertAllCalledExactlyOnce(t *testing.T) bool
func (*ModelService) Close ¶
func (m *ModelService) Close()
func (*ModelService) URL ¶
func (m *ModelService) URL() string
Click to show internal directories.
Click to hide internal directories.