Documentation ¶
Overview ¶
Package testutil provides utilities (decorators, helpers, assertions...) for testing
Index ¶
Constants ¶
View Source
const ( // EnvVarMySQLTest is the environment var, which must be present to run // MySQL tests EnvVarMySQLTest = "PAYMENTD_MYSQLTEST" // EnvVarMySQLTestPaymentDSN holds the DSN for the test database for payment EnvVarMySQLTestPaymentDSN = "PAYMENTD_MYSQLTEST_PAYMENTDSN" // EnvVarMySQLTestPaymentDSN holds the DSN for the test database for payment EnvVarMySQLTestPrincipalDSN = "PAYMENTD_MYSQLTEST_PRINCIPALDSN" )
Variables ¶
This section is empty.
Functions ¶
func WithContext ¶
WithContext is a decorator for GoConvey based tests
It will inject a service context and a log channel, where log messages can be read from
func WithPaymentDB ¶
WithPaymentDB is a test decorator providing a DB connection to the test payment DB
Types ¶
type ResponseWriter ¶
ResponseWriter is a mock http.ResponseWriter which can be used to inspect HTTP handler responses
func NewResponseWriter ¶
func NewResponseWriter() *ResponseWriter
NewResponseWriter creates a response writer to capture http handler responses
func (*ResponseWriter) Header ¶
func (r *ResponseWriter) Header() http.Header
Header implementing the http.ResponseWriter
func (*ResponseWriter) Write ¶
func (r *ResponseWriter) Write(p []byte) (int, error)
Write implementing the http.ResponseWriter, io.Writer
func (*ResponseWriter) WriteHeader ¶
func (r *ResponseWriter) WriteHeader(statusCode int)
WriteHeader implementing the http.ResponseWriter
Click to show internal directories.
Click to hide internal directories.