 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
testhost provides an implementation of a test server for UCP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestHost ¶
TestHost provides a test host for the UCP server.
func Start ¶
func Start(t *testing.T, opts ...TestHostOption) *TestHost
Start creates and starts a new TestServer.
func (*TestHost) Options ¶
Internals provides access to the internal options of the server. This allows tests to access the data stores and manipulate the server state.
func (*TestHost) UCP ¶
func (ts *TestHost) UCP() *v20231001preview.ClientFactory
UCP provides access to the generated clients for the UCP API.
type TestHostOption ¶
type TestHostOption interface {
	// Apply applies the configuration to the UCP options.
	Apply(options *ucp.Options)
}
    TestHostOption can be used to configure the UCP options before the server is started.
type TestHostOptionFunc ¶
TestHostOptionFunc is a function that implements the TestHostOption interface.
func NoModules ¶
func NoModules() TestHostOptionFunc
NoModules is a TestHostOption that disables all UCP modules.
func (TestHostOptionFunc) Apply ¶
func (f TestHostOptionFunc) Apply(options *ucp.Options)
Apply applies the function to the UCP options.
type TestServerMocks ¶
type TestServerMocks struct {
	// DatabaseClient is the mock database client.
	DatabaseClient *database.MockClient
	// DatabaseProvider is the mock database provider.
	DatabaseProvider *databaseprovider.DatabaseProvider
	// QueueClient is the mock queue client.
	QueueClient *queue.MockClient
	// QueueProvider is the mock queue provider.
	QueueProvider *queueprovider.QueueProvider
	// SecretClient is the mock secret client.
	SecretClient *secret.MockClient
	// SecretProvider is the mock secret provider.
	SecretProvider *secretprovider.SecretProvider
	// StatusManager is the mock status manager.
	StatusManager *statusmanager.MockStatusManager
}
    TestServerMocks provides access to mock instances created by the TestServer.
func NewMocks ¶
func NewMocks(t *testing.T) *TestServerMocks
NewMocks creates a new set of mocks for the test server.
func (*TestServerMocks) Apply ¶
func (m *TestServerMocks) Apply(options *ucp.Options)
Apply updates the UCP options to use the mocks.