common

package
v0.0.0-...-a423d60 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const DirectorServer = "director-server"
View Source
const SystemBrokerServer = "system-broker-server"

Variables

This section is empty.

Functions

func TestEnv

func TestEnv() env.Environment

Types

type ConfigRequestBody

type ConfigRequestBody struct {
	GraphqlQueryKey
	Response interface{}
}

type FakeServer

type FakeServer interface {
	// contains filtered or unexported methods
}

type GqlFakeRouter

type GqlFakeRouter struct {
	ResponseConfig map[GraphqlQueryKey][]interface{}
	Schema         *ast.Schema
	// contains filtered or unexported fields
}

func NewGqlFakeRouter

func NewGqlFakeRouter(schemaName, path string) (*GqlFakeRouter, error)

func (*GqlFakeRouter) Handler

func (g *GqlFakeRouter) Handler() http.Handler

type GqlFakeServer

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

func NewGqlFakeServer

func NewGqlFakeServer(h http.Handler) *GqlFakeServer

func (*GqlFakeServer) Close

func (g *GqlFakeServer) Close()

func (*GqlFakeServer) URL

func (g *GqlFakeServer) URL() string

type GraphqlQueryKey

type GraphqlQueryKey struct {
	Type string
	Name string
}

type TestContext

type TestContext struct {
	SystemBroker *httpexpect.Expect
	HttpClient   *http.Client
	Servers      map[string]FakeServer
}

func (*TestContext) CleanUp

func (tc *TestContext) CleanUp()

func (*TestContext) ConfigureResponse

func (tc *TestContext) ConfigureResponse(configURL, queryType, queryName, response string) error

type TestContextBuilder

type TestContextBuilder struct {
	Environment env.Environment

	Servers    map[string]FakeServer
	HttpClient *http.Client
	// contains filtered or unexported fields
}

func NewTestContextBuilder

func NewTestContextBuilder() *TestContextBuilder

NewTestContextBuilder sets up a builder with default values

func (*TestContextBuilder) Build

func (tcb *TestContextBuilder) Build(t *testing.T) *TestContext

func (*TestContextBuilder) WithDefaultEnv

func (tcb *TestContextBuilder) WithDefaultEnv(env env.Environment) *TestContextBuilder

func (*TestContextBuilder) WithEnvExtensions

func (tcb *TestContextBuilder) WithEnvExtensions(fs ...func(e env.Environment, servers map[string]FakeServer)) *TestContextBuilder

func (*TestContextBuilder) WithHttpClient

func (tcb *TestContextBuilder) WithHttpClient(client *http.Client) *TestContextBuilder

Jump to

Keyboard shortcuts

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