servicetesting

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataBackendOptions

type DataBackendOptions struct {
	Repository           string
	Tag                  string
	EnvironmentVariables []string
	Cmd                  string

	RelevantPort string
}

func CreatePostgresDatabaseBackendOptions

func CreatePostgresDatabaseBackendOptions(postgresPassword string) *DataBackendOptions

func CreateRedisDatabaseBackendOptions

func CreateRedisDatabaseBackendOptions() *DataBackendOptions

type DatabaseBackend

type DatabaseBackend struct {
	URI string
	// contains filtered or unexported fields
}

type Environment

type Environment struct {
	TestServer *gin.Engine
	// contains filtered or unexported fields
}

Environment contains all information and all references needed to create and use a test environment

func NewGinTestEnvironment

func NewGinTestEnvironment(dbOpts *DataBackendOptions, bearerToken string) (*Environment, error)

func (*Environment) DoRequest

func (env *Environment) DoRequest(relativeURL string, method string, body []byte) (*httptest.ResponseRecorder, error)

DoRequests makes a request to the test environment

func (*Environment) GetDatabaseBackendURI

func (env *Environment) GetDatabaseBackendURI() string

GetDatabaseBackendURI returns the domain and port of the created database backend

func (*Environment) Teardown

func (env *Environment) Teardown() error

Jump to

Keyboard shortcuts

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