testsupport

package
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppTestHandler

func AppTestHandler(t *testing.T) http.HandlerFunc

func AppsTestHandler

func AppsTestHandler(t *testing.T) http.HandlerFunc

func AutoScalerAppInstancesTestHandler

func AutoScalerAppInstancesTestHandler(t *testing.T) http.HandlerFunc

func AutoScalerRulesTestHandler

func AutoScalerRulesTestHandler(t *testing.T) http.HandlerFunc

func AutoScalerSchedulesTestHandler

func AutoScalerSchedulesTestHandler(t *testing.T) http.HandlerFunc

func DomainsTestHandler

func DomainsTestHandler(t *testing.T) http.HandlerFunc

func ExportTestHandler

func ExportTestHandler(t *testing.T) http.Handler

func ImportTestHandler

func ImportTestHandler(t *testing.T) http.Handler

func InfoTestHandler

func InfoTestHandler(t *testing.T) http.HandlerFunc

func JSONTestHandler

func JSONTestHandler(t *testing.T, data string) http.HandlerFunc

func NewTestCFClient

func NewTestCFClient(t *testing.T, s *httptest.Server) cf.Client

NewTestCFClient creates a cf client for use in tests

func OrgTestHandler

func OrgTestHandler(t *testing.T) http.HandlerFunc

func OrgsTestHandler

func OrgsTestHandler(t *testing.T) http.HandlerFunc

func PackagesTestHandler

func PackagesTestHandler(t *testing.T) http.HandlerFunc

func ServiceBindingsTestHandler

func ServiceBindingsTestHandler(t *testing.T) http.HandlerFunc

func ServiceInstancesTestHandler

func ServiceInstancesTestHandler(t *testing.T) http.HandlerFunc

func SpaceTestHandler

func SpaceTestHandler(t *testing.T) http.HandlerFunc

func SpacesTestHandler

func SpacesTestHandler(t *testing.T) http.HandlerFunc

func StacksTestHandler

func StacksTestHandler(t *testing.T) http.HandlerFunc

func TestMux

func TestMux(handlers ...func() (string, http.HandlerFunc)) http.Handler

func V3RoutesTestHandler

func V3RoutesTestHandler(t *testing.T) http.HandlerFunc

func WithHTTPHandler

func WithHTTPHandler(pattern string, f http.HandlerFunc) func() (string, http.HandlerFunc)

func WithTestHandler

func WithTestHandler(t *testing.T, pattern string, f TestHandlerFunc) func() (string, http.HandlerFunc)

Types

type StubClient

type StubClient struct {
	*fakes.FakeClient
	DoFunc          func(req *http.Request) (*http.Response, error)
	DoWithRetryFunc func(f func() error) error
	HTTPClientFunc  func() *http.Client
	TargetFunc      func() string
	GetFunc         func(url string) ([]byte, error)
}

func (StubClient) Do

func (s StubClient) Do(req *http.Request) (*http.Response, error)

func (StubClient) DoWithRetry

func (s StubClient) DoWithRetry(f func() error) error

func (StubClient) Get

func (s StubClient) Get(url string) ([]byte, error)

func (StubClient) HTTPClient

func (s StubClient) HTTPClient() *http.Client

func (StubClient) Target

func (s StubClient) Target() string

type TestHandlerFunc

type TestHandlerFunc func(t *testing.T) http.HandlerFunc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL