Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateResourceTestHandlers ¶
func CreateResourceTestHandlers(t *testing.T, config ResourceTestConfig, tracker *APICallTracker) map[string]MockEndpointHandler
CreateResourceTestHandlers creates standard CRUD handlers for testing any dbt Cloud resource
Types ¶
type APICallTracker ¶
APICallTracker tracks API calls made during testing
type CapturedCall ¶
CapturedCall holds the details of a single HTTP request received by the mock server
type MockEndpointHandler ¶
type MockEndpointHandler func(r *http.Request) (statusCode int, responseBody interface{}, err error)
MockEndpointHandler is a function that inspects a request and dynamically determines the response
type MockServer ¶
MockServer is a wrapper around httptest.Server that captures calls
func SetupMockServer ¶
func SetupMockServer(t *testing.T, handlers map[string]MockEndpointHandler) *MockServer
SetupMockServer creates and starts a new MockServer using dynamic handlers
func (*MockServer) GetCapturedCalls ¶
func (m *MockServer) GetCapturedCalls(path string) []*CapturedCall
GetCapturedCalls returns all captured calls for a given path
Click to show internal directories.
Click to hide internal directories.