selectivegatewayservicegeneratedmock

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClientNodes

type MockClientNodes struct {
	Mirror *mirrorclientgenerated.MockClient
	Echo   *echoclientgenerated.MockClientWithFixture
}

MockClientNodes contains mock client dependencies

func InitializeDependenciesMock

func InitializeDependenciesMock(
	g *zanzibar.Gateway,
	ctrl *gomock.Controller,
) (*module.DependenciesTree, *module.Dependencies, *MockClientNodes)

InitializeDependenciesMock fully initializes all dependencies in the dep tree for the selective-gateway service with leaf nodes being mocks

type MockService

type MockService interface {
	MakeHTTPRequest(
		method string,
		url string,
		headers map[string]string,
		body io.Reader,
	) (*http.Response, error)
	MakeTChannelRequest(
		ctx context.Context,
		thriftService string,
		method string,
		headers map[string]string,
		req, resp zanzibar.RWTStruct,
	) (bool, map[string]string, error)
	MockClients() *MockClientNodes
	Server() *zanzibar.Gateway
	Start()
	Stop()
}

MockService interface

func MustCreateTestService

func MustCreateTestService(t *testing.T, testConfigPaths ...string) MockService

MustCreateTestService creates a new MockService, panics if it fails doing so. Optional testConfigPaths specifies runtime config files used in tests, it should be paths that are relative to "$GOPATH/src". If testConfigPaths is absent, a default test config file is used. The default test config file is chosen base on existence in order below: - "../../config/test.yaml" where current dir is the dir of service-config.yaml for the mocked service - "config/test.yaml" where current dir is the project root

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL