testutil

package
v0.0.0-...-d10cdba Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HandlerOptions  map[string]*util.HandlerOptions
	IntegrationTest = &IntegrationTestStruct{
		IntegrationTest: &types.IntegrationTest{},
	}
)

Functions

func CheckServer

func CheckServer() error

func GetClientSocketConnection

func GetClientSocketConnection(ticket string) (net.Conn, error)

func GetSocketTicket

func GetSocketTicket(client *http.Client, userId string) (string, string)

func GetTestReq

func GetTestReq(method, target string, body io.Reader) *http.Request

func LoadIntegrations

func LoadIntegrations()

func ResetB

func ResetB(b *testing.B)

func SaveIntegrations

func SaveIntegrations()

func StartTestServer

func StartTestServer() (*exec.Cmd, error)

func TestPanic

func TestPanic(t *testing.T) func()

Types

type IntegrationTestStruct

type IntegrationTestStruct struct {
	TestUsers map[int32]*TestUsersStruct `json:"testUsers"`
	*types.IntegrationTest
}

func (*IntegrationTestStruct) GetTestUsers

func (its *IntegrationTestStruct) GetTestUsers() map[int32]*TestUsersStruct

type TestUsersStruct

type TestUsersStruct struct {
	Client     *http.Client
	CookieData []http.Cookie
	*types.TestUser
}

func NewTestUser

func NewTestUser(userId, email, pass string) *TestUsersStruct

func (*TestUsersStruct) DoHandler

func (tus *TestUsersStruct) DoHandler(method, path string, body []byte, queryParams map[string]string, responseObj proto.Message) error

func (*TestUsersStruct) GetDateSlots

func (tus *TestUsersStruct) GetDateSlots(masterScheduleId string) ([]*types.IGroupScheduleDateSlots, error)

func (*TestUsersStruct) GetMasterScheduleById

func (tus *TestUsersStruct) GetMasterScheduleById(groupScheduleId string) (*types.IGroupSchedule, error)

func (*TestUsersStruct) GetProfileDetails

func (tus *TestUsersStruct) GetProfileDetails() (*types.IUserProfile, error)

func (*TestUsersStruct) GetQuoteById

func (tus *TestUsersStruct) GetQuoteById(quoteId string) (*types.IQuote, error)

func (*TestUsersStruct) GetScheduleById

func (tus *TestUsersStruct) GetScheduleById(scheduleId string) (*types.ISchedule, error)

func (*TestUsersStruct) GetServiceById

func (tus *TestUsersStruct) GetServiceById(serviceId string) (*types.IService, error)

func (*TestUsersStruct) GetUserSession

func (tus *TestUsersStruct) GetUserSession(pool *pgxpool.Pool) (*types.ConcurrentUserSession, error)

func (*TestUsersStruct) Login

func (tus *TestUsersStruct) Login(handler ...*http.ServeMux) ([]*http.Cookie, error)

func (*TestUsersStruct) Logout

func (tus *TestUsersStruct) Logout(handler ...*http.ServeMux) error

func (*TestUsersStruct) PatchGroupAssignments

func (tus *TestUsersStruct) PatchGroupAssignments(roleFullName, actionName string) error

func (*TestUsersStruct) PatchGroupUser

func (tus *TestUsersStruct) PatchGroupUser(userSub, roleId string) error

func (*TestUsersStruct) PostBooking

func (tus *TestUsersStruct) PostBooking(bookingRequests []*types.IBooking) ([]*types.IBooking, error)

func (*TestUsersStruct) PostGroupSchedule

func (tus *TestUsersStruct) PostGroupSchedule(scheduleId string) error

func (*TestUsersStruct) PostQuote

func (tus *TestUsersStruct) PostQuote(serviceTierId string, slot *types.IGroupScheduleDateSlots, serviceForm, tierForm *types.IProtoFormVersionSubmission) (*types.IQuote, error)

func (*TestUsersStruct) PostSchedule

func (tus *TestUsersStruct) PostSchedule(scheduleRequest *types.PostScheduleRequest) (*types.ISchedule, error)

func (*TestUsersStruct) RegisterKeycloakUserViaForm

func (tus *TestUsersStruct) RegisterKeycloakUserViaForm(code ...string) error

func (*TestUsersStruct) SetCookieData

func (tus *TestUsersStruct) SetCookieData(cookies []*http.Cookie)

Jump to

Keyboard shortcuts

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