apiutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package apiutils implements the api test utils.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestGRPCGatewayAPIClient added in v1.0.0

func NewTestGRPCGatewayAPIClient(
	t *testing.T,
	addr string,
	extraDialOpts ...connect.ClientOption,
) payer_apiconnect.PayerApiClient

func NewTestGRPCMetadataAPIClient added in v1.0.0

func NewTestGRPCMetadataAPIClient(
	t *testing.T,
	addr string,
	extraDialOpts ...connect.ClientOption,
) metadata_apiconnect.MetadataApiClient

func NewTestGRPCReplicationAPIClient added in v1.0.0

func NewTestGRPCReplicationAPIClient(
	t *testing.T,
	addr string,
	extraDialOpts ...connect.ClientOption,
) message_apiconnect.ReplicationApiClient

Types

type APIServerMocks added in v0.5.1

type APIServerMocks struct {
	MockRegistry          *mocks.MockNodeRegistry
	MockValidationService *mlsvalidateMocks.MockMLSValidationService
	MockMessagePublisher  *blockchain.MockIBlockchainPublisher
}

type APIServerTestSuite added in v1.0.0

type APIServerTestSuite struct {
	APIServer         *api.APIServer
	ClientReplication message_apiconnect.ReplicationApiClient
	ClientPayer       payer_apiconnect.PayerApiClient
	ClientMetadata    metadata_apiconnect.MetadataApiClient
	DB                *sql.DB
	APIServerMocks    APIServerMocks
}

func NewTestAPIServer

func NewTestAPIServer(
	t *testing.T,
) *APIServerTestSuite

NewTestAPIServer creates a full API server with all services. It creates a mock database, mock registry, mock validation service, mock message publisher, and mock API server. It returns the mock API server, mock database, and mock API server mocks.

Jump to

Keyboard shortcuts

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