xyzservicegeneratedmock

package
v2.0.17 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClientNodes

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 app/demo/xyz 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
y or Y : Canonical URL