testhelper

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetValidMailNotificationChannel added in v0.12.0

func GetValidMailNotificationChannel() maildto.MailNotificationChannelRequest

func GetValidMattermostNotificationChannel added in v0.12.0

func GetValidMattermostNotificationChannel() mattermostdto.MattermostNotificationChannelRequest

func GetValidTeamsNotificationChannel added in v0.12.0

func GetValidTeamsNotificationChannel() teamsdto.TeamsNotificationChannelRequest

func MockAuthMiddleware added in v0.7.0

func MockAuthMiddleware(ctx *gin.Context)

MockAuthMiddleware mocks authentication by setting a default user context in the Gin context for testing purposes.

func MockAuthMiddlewareWithAdmin added in v0.12.0

func MockAuthMiddlewareWithAdmin(ctx *gin.Context)

MockAuthMiddleware mocks authentication by setting a admin user context in the Gin context for testing purposes.

func MockAuthMiddlewareWithNotificationUser added in v0.12.0

func MockAuthMiddlewareWithNotificationUser(ctx *gin.Context)

MockAuthMiddleware mocks authentication by setting a notification user context in the Gin context for testing purposes.

func NewJSONRequest

func NewJSONRequest(method, url string, bodyAsStruct any) (*http.Request, error)

NewJSONRequest wraps http.NewRequest and sets the passed struct as body

func NewTestWebEngine added in v0.12.0

func NewTestWebEngine(registry *errmap.Registry) *gin.Engine

func SetupNotificationChannelTestEnv added in v0.12.0

func SetupNotificationChannelTestEnv(t *testing.T) (notificationrepository.NotificationChannelRepository, *sqlx.DB)

func VerifyResponseWithMetadata

func VerifyResponseWithMetadata[T any](
	t *testing.T,
	wantResponseCode int, wantResponseParsed T,
	gotResponse *httptest.ResponseRecorder,
)

Types

This section is empty.

Jump to

Keyboard shortcuts

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