testutil

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestLogger

func NewTestLogger(t *testing.T) logger.Logger

Types

type CallCount

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

func (*CallCount) Get

func (c *CallCount) Get(method, path string) int

func (*CallCount) Inc

func (c *CallCount) Inc(method, path string) int

type TestServer

type TestServer struct {
	Server    *httptest.Server
	Config    *TestServerConfig
	CallCount CallCount
	// contains filtered or unexported fields
}

func NewTestServer

func NewTestServer(t *testing.T, config *TestServerConfig) *TestServer

func (*TestServer) Handle

func (s *TestServer) Handle(t *testing.T, method, path string, handler TestServerHandler)

func (*TestServer) HandleAuthenticated

func (s *TestServer) HandleAuthenticated(t *testing.T, method, path string, handler TestServerHandler)

type TestServerConfig

type TestServerConfig struct {
	Audience     string
	ClientID     string
	ClientSecret string
	GrantType    string
	AccessToken  string
	Scopes       []string
}

func DefaultTestServerConfig

func DefaultTestServerConfig() *TestServerConfig

type TestServerHandler

type TestServerHandler func(header http.Header, query url.Values, body []byte) (int, string)

Jump to

Keyboard shortcuts

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