testsupport

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertExists added in v0.1.6

func AssertExists(file []byte, err error) []byte

func AssertGetContains added in v0.1.6

func AssertGetContains(t *testing.T, app *http.Server, uri string, expected string)

func AssertGetWithCookieContains added in v0.1.6

func AssertGetWithCookieContains(t *testing.T, app *http.Server, client *http.Client, cookie *http.Cookie, uri string, expected string)

func ContainsExactly added in v0.1.6

func ContainsExactly[T any](t *testing.T, arrayToCheck []T, elementsToCheck ...T)

func WithSetUp

func WithSetUp[T TestData](data T, test func(data T))

Types

type FakeAuthServer added in v0.1.6

type FakeAuthServer struct {
	Issuer string

	Server *httptest.Server
	// contains filtered or unexported fields
}

func NewFakeAuthServer added in v0.1.6

func NewFakeAuthServer(clientID string, claims map[string]interface{}) *FakeAuthServer

type MockHTTPClient added in v0.1.6

type MockHTTPClient struct {
	mock.Mock
	Err          error
	ResponseBody map[string][]byte
	RequestBody  []byte
	Url          string
	StatusCode   int
}

func NewMockHTTPClient added in v0.1.6

func NewMockHTTPClient() *MockHTTPClient

func (*MockHTTPClient) Do added in v0.1.6

func (m *MockHTTPClient) Do(req *http.Request) (*http.Response, error)

func (*MockHTTPClient) Get added in v0.1.6

func (m *MockHTTPClient) Get(url string) (resp *http.Response, err error)

func (*MockHTTPClient) Post added in v0.1.6

func (m *MockHTTPClient) Post(url, _ string, body io.Reader) (resp *http.Response, err error)

type SigningKey added in v0.1.6

type SigningKey struct {
	// contains filtered or unexported fields
}

type TestData

type TestData interface {
	SetUp()
	TearDown()
}

Directories

Path Synopsis
Package tools provides utilities for tests.
Package tools provides utilities for tests.

Jump to

Keyboard shortcuts

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